How to schedule Artisan commands in a package?

In Laravel 6.10 and above:

use Illuminate\Support\ServiceProvider;
use Illuminate\Console\Scheduling\Schedule;

class ScheduleServiceProvider extends ServiceProvider
{
    public function boot()
    {
        $this->callAfterResolving(Schedule::class, function (Schedule $schedule) {
            $schedule->command('some:command')->everyMinute();
        });
    }

    public function register()
    {
    }
}

(see Dave's answer below for Laravel 6.10+)

The trick is to wait until after the Application has booted to schedule the commands, since that is when Laravel defines the Schedule instance and then schedules commands internally. Hope this saves someone a few hours of painful debugging!

use Illuminate\Support\ServiceProvider;
use Illuminate\Console\Scheduling\Schedule;

class ScheduleServiceProvider extends ServiceProvider
{
    public function boot()
    {
        $this->app->booted(function () {
            $schedule = $this->app->make(Schedule::class);
            $schedule->command('some:command')->everyMinute();
        });
    }

    public function register()
    {
    }
}