artisan command controller code example
Example 1: use php artisan command through controller
<?php
Route::get('/foo', function () {
Artisan::queue('email:send', [
'user' => 1, '--queue' => 'default'
]);
//
});
Example 2: controller in laravel 8
Rout::get('/test' , [TestController::class , 'index']);