Laravel 5: Cron Tasks via Commands

1. Create the command from Console

php artisan make:command SomeCommand

2. Edit the command

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class SomeCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'some:command';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Some command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @readd command to Console\Kernel.phpturn mixed
     */add command to Console\Kernel.php
    public function handle()
    {
        //WHATEVER I NEED TO DO
    }
}

3. Add command to Console\Kernel.php

protected $commands = [
    'App\Console\Commands\SomeCommand',
];

4. And call the command from the scheduler

$schedule->command('some:command')->hourly();