1//go to App\Console\Kernel
2//for see all run the " php artisan schedule:list "
3//for run that run the " php artisan schedule:work "
4
5<?php
6
7namespace App\Console;
8
9use Illuminate\Console\Scheduling\Schedule;
10use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
11use Illuminate\Support\Facades\DB;
12
13class Kernel extends ConsoleKernel
14{
15 /**
16 * The Artisan commands provided by your application.
17 *
18 * @var array
19 */
20 protected $commands = [
21 //
22 ];
23
24 /**
25 * Define the application's command schedule.
26 *
27 * @param \Illuminate\Console\Scheduling\Schedule $schedule
28 * @return void
29 */
30 protected function schedule(Schedule $schedule)
31 {
32 $schedule->call(function () {
33 DB::table('recent_users')->delete();
34 })->daily();
35 }
36}