🤹
🤹
🤹
🤹
TALL Stack Tips
Search…
🤹
🤹
🤹
🤹
TALL Stack Tips
What is TALL Stack
Tailwind
Tailwind Resources
Swinging Bell Notification Icon
Alpine
Alpine Resources
Tabbed Content Using Alpine JS
Checkbox component with SVG tick
Dropdown animation
Create a Sliding Puzzle Captcha
Laravel
Tabler Icons Component
Password-less Login with Laravel 8
Password-less Login with Magic Link in Laravel 8
Laravel Resources
Laravel 8 Conditional Login Redirect
Simplify Laravel CRUD Controllers
CSRF and expired login forms
CSRF and expired logout forms
Specify a different mail theme for Notifications
Using a mutator to save currency
Using Spatie Valuestore to hold frequently accessed settings
Using the old() helper
Alternatives to using Eloquent Accessor
UpdateOrCreate may not update timestamp
Use of lockForUpdate()
Using S3
Super Simple User Based Feature Flags
Installing a Specific Version of Laravel
Versioning your Laravel Project
CSS Cache Busting with your Git Commit SHA
Adding column to Database Notifications table
Find nearby locations using the Haversine formula in Eloquent query
Using Queues on Shared Hosting with Laravel
Create Guaranteed Unique Invoice Number in Laravel
PHP DateTime formatting cribsheet
Livewire
Livewire Resources
Naming Livewire Components
Dynamic Cascading Dropdown with Livewire
Hiding a button after click
Working with Javascript Components
SweetAlert2 with Livewire
Clearing checkboxes in Livewire
Livewire File Uploads Using S3
Simple Log File Viewer
Related Resources
Testing resources
When Composer runs out of memory
Deployment
Security
Scheduler & Cron tips
LastPass tips
Using Git
VSCode Tips
Markdown
Cpanel resources
Powered By
GitBook
Using Queues on Shared Hosting with Laravel
When all you have is CRON
Sometimes, shared hosting must be used that does not permit the installation of supervisor to run the queue worker.
A common example of this are servers deployed with Cpanel access only.
One approach for non-time sensitive queue work (such as sending emails) is to add a task to the scheduler that starts the queue worker every minute;
$schedule
->
command
(
'queue:work --stop-when-empty'
)
->
everyMinute
()
->
withoutOverlapping
();
Adding this line to the scheduler in app\Console\Kernel.php and then setting up a cron job to run the scheduler, ensures that the queue gets serviced every minute.
For Cpanel servers, the Cron statement might look like;
* * * * * /usr/local/bin/php /home/{account_name}/live/artisan schedule:run
where
{account_name}
is the user account that cpanel is running under and
live
is the folder of the laravel application
Laravel - Previous
Find nearby locations using the Haversine formula in Eloquent query
Next - Laravel
Create Guaranteed Unique Invoice Number in Laravel
Last modified
1mo ago
Copy link