How to run a function with Scheduling Artisan Commands Laravel 5?

I want run a controller function on schedule time. Is it possible? then how?
I wrote a function on app/console/Kernel.php and run php artisan schedule:run but it shown

No scheduled commands are ready to run.

$schedule->call(function() {
    $user = new User();
    $user->name     = 'Shaon'.rand(99,999);
    $user->email    = 'shaon'.rand(99,999).'@live.com';
    $user->password = '+88'.rand(99,999);
    $user->save();
})->everyFiveMinutes();

What actually do now?


Source: laravel

Leave a Reply