When using:
QUEUE_CONNECTION=databaseon production, you must run a queue worker continuously. Otherwise queued jobs such as password reset emails, notifications, and other background tasks will remain in the jobs table and never be processed.
Author: Madhavendra Dutt
GitHub: https://github.com/mdutt247
Created: 05th March 2026
License: MIT
Stack: Laravel, MySQL, WordPress
Website: MDITech
| # Host Laravel in sub-directory on Nginx | |
| location = /laravel-app { | |
| return 301 /laravel-app/; | |
| } | |
| location /laravel-app/ { | |
| alias /var/www/laravel-app/public/; | |
| try_files $uri $uri/ @laravelproject; | |
| } |
| To send an email notification whenever a file or directory changes in multiple watch directories while excluding certain subdirectories, | |
| you can use inotifywait (from inotify-tools) along with mail or sendmail. | |
| sudo apt update | |
| sudo apt install inotify-tools mailutils -y | |
| Here | |
| inotify-tools: Monitors filesystem changes. | |
| mailutils: Enables email sending (for mail command). |
| ############ WordPress #################### | |
| # Disable logging for favicon and robots.txt | |
| location = /favicon.ico { | |
| try_files /favicon.ico @empty; | |
| access_log off; | |
| log_not_found off; | |
| expires max; | |
| } |
| # Author: M. Dutt (hello@mditech.net) | |
| # Date: 27/11/2023 | |
| # Purpose: Laravel command to update the application (git pull and composer install) using Laravel scheduler. | |
| # | |
| # Running The Scheduler | |
| # The schedule:run Artisan command will evaluate all of your scheduled tasks and determine if they need to run based on the server's current time. | |
| # Create a cron job in your server | |
| # * * * * * cd /path/to/project && php artisan schedule:run >> storage/logs/cron.log 2>&1 | |
| # | |
| # Directory structure |
| # Author: M. Dutt (hello@mditech.net) | |
| # Date: 20/11/2023 | |
| # Purpose: Correct file and directory permissions of Laravel project. | |
| # | |
| Change the owner and group of your Laravel project. | |
| sudo chown -R developer:www-data /var/www/project | |
| OR | |
| sudo chown -R developer:apache /var/www/project |
| #!/usr/bin/env bash | |
| # Author: M. Dutt (hello@mditech.net) | |
| # Date: 19/11/2023 | |
| # Purpose: Clamav daily scan. | |
| # | |
| # chmod +x /path/to/script/clamscan_daily.sh | |
| # | |
| # 01 * * * * /path/to/script/clamscan_daily.sh | |
| # |
| #!/usr/bin/env bash | |
| # Author: M. Dutt (hello@mditech.net) | |
| # Date: 19/11/2023 | |
| # Purpose: Clamav hourly scan. | |
| # | |
| # chmod +x /path/to/script/clamscan_hourly.sh | |
| # | |
| # 01 * * * * /path/to/script/clamscan_hourly.sh | |
| # |