how to schedule command in laravle programticaly in contrller function code example
Example: Laravel Scheduler
$schedule->call(function () {
DB::table('users')->whereYear('last_login_at','<',date('Y')-1)->delete();
})->daily();
$schedule->call(function () {
DB::table('users')->whereYear('last_login_at','<',date('Y')-1)->delete();
})->daily();