How to show laravel api error in digitalocean?

743 Views Asked by At

I deploy my Laravel + vue project on the Digitalocean apps and some of my api are working but some are not. When I look into the api response I received message: "Server Error", But the api is working on localhost and gives error after the deployment.

Is there a way to view the actual error message of the api reponse? so that I can easily understand what causing the error and fix it.

But I really find it weird that it causing error in the digitalocean apps, but works on my local machine.

I've tried searching for hours how to view the errors but I can't find it. please help me. Thank you!

1

There are 1 best solutions below

1
On BEST ANSWER

You can log in to your server and look in the file storage/logs/laravel.log.

Otherwise, I would suggest using a service such as Bugsnag or Sentry, which have integrations with laravel and will give you a dashboard with all your errors

Some people suggest putting APP_DEBUG to true, but that is a security risk as your customers will be able to see the error as well, and you should never do this on a production server