app/Console/Commands/DemoCron.php
/**
     * Execute the console command.
     *
     * @return int
     */
Execute the console command.
@return int
Execute the console command . @return int
public function handle()
    {
        \Log::info("Cron is working fine!");
        $model = new \App\Models\Classes();
        $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $charactersLength = strlen($characters);
        $randomString = '';
        for ($i = 0; $i < 20; $i++) {
            $randomString .= $characters[rand(0, $charactersLength - 1)];
        }
        $model->name = $randomString;
        $model->save();
        $this->info('Demo:Cron Cummand Run successfully!');
    }
public function handle ( ) { \ Log :: info ( " Cron is working fine! " ) ; $ model = new \ App \ Models \ Classes ( ) ; $ characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ; $ charactersLength = strlen ( $ characters ) ; $ randomString = '' ; for ( $ i = 0 ; $ i < 20 ; $ i ++ ) { $ randomString .= $ characters [ rand ( 0 , $ charactersLength - 1 ) ] ; } $ model -> name = $ randomString ; $ model -> save ( ) ; $ this -> info ( 'Demo:Cron Cummand Run successfully!' ) ; }
Execute the console command.
Execute the console command .