Laravel: Maintenance Mode [proper usage with internal working]
Enabling maintenance mode allows us to show nice and use friendly messages when our application is going through some maintenance work under the hood, and we are not able to serve.
Laravel Tutorials
Enabling maintenance mode allows us to show nice and use friendly messages when our application is going through some maintenance work under the hood, and we are not able to serve.
The Repository pattern just moves the Eloquent model usage to the repositories. We will use the repository from our controller to perform database operations. We will still be using the Eloquent models inside our repository.
In production you have to run this command using some process manager that will keep the command running. 2 most simple ways to do that is using Supervisor or PM2.I use pm2 in such cases, as this seems simpler to me. Let’s see how to use PM2 for running Laravel workers in the background.
To avoid this situation, never use env(“ANY_VAR”) directly in your code. Instead, use it like config(“config_file_name.var_name”).