الطوابير بالتفصيل:
إنشاء مهمة
php artisan make:job ProcessPodcastفئة المهمة
class ProcessPodcast implements ShouldQueue
{
use Queueable;
public function __construct(public Podcast $podcast) {}
public function handle()
{
// المعالجة...
}
}الإرسال
ProcessPodcast::dispatch($podcast);
ProcessPodcast::dispatch($podcast)->delay(now()->addMinutes(10));المهام الفاشلة
public function failed(Throwable $exception)
{
// معالجة الفشل
}تشغيل العامل
php artisan queue:work --tries=3