1. Scheduling in Laravel:
Scheduling allows you to run tasks automatically at a specific time without manually executing commands.
Real-Life Example:
- Send daily reports at 9:00 AM
- Delete temporary files every night
- Send birthday emails every morning
app/Console/Kernel.php
protected function schedule(Schedule $schedule)
{
$schedule->command('emails:send')->daily();
}Run the emails:send command every day.
$schedule->command('demo')->everyMinute();
$schedule->command('demo')->hourly();
$schedule->command('demo')->daily();
$schedule->command('demo')->weekly();2. Broadcasting in Laravel ?
Broadcasting sends real-time events to users without refreshing the page.
Real-Life Example
- WhatsApp new message
- Facebook notification
- Live chat
- Live cricket score
- Example
Laravel uses:
- Pusher
- Laravel Reverb
- WebSockets