Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ottz0's avatar
Level 2

Running php artisan error

Can anyone help me with this error as I'm trying to run php artisan migrate.

Also I am using Vagrant so i'm not sure if you can run artisan commands inside a vagrant machine?

PHP Warning:  Declaration of App\Console\Kernel::schedule(App\Console\Schedule $schedule) should be compatible with Illuminate\Foundation\Console\Kernel::schedule(Illuminate\Console\Scheduling\Schedule $schedule) in /home/ubuntu/sites/laravue/backend/app/Console/Kernel.php on line 7

 [Symfony\Component\Debug\Exception\FatalThrowableError]                                          
  Type error: Argument 1 passed to App\Console\Kernel::schedule() must be an instance of App\Cons  
  ole\Schedule, instance of Illuminate\Console\Scheduling\Schedule given, called in /home/ubuntu/  
  sites/laravue/backend/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php on   
  line 104    
0 likes
5 replies
s4muel's avatar

show us your schedule() method from /home/ubuntu/sites/laravue/backend/app/Console/Kernel.php

should be something like this:

//...
use Illuminate\Console\Scheduling\Schedule;
//...
protected function schedule(Schedule $schedule)
{
    //...
}

mind the $schedule argument type and the use

ottz0's avatar
Level 2
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

protected function schedule(Schedule $schedule)
    {
        // $schedule->command('inspire')
        //          ->hourly();
    }
ottz0's avatar
Level 2

I have no

use Illuminate\Console\Scheduling\Schedule;
s4muel's avatar

add that, try it and let me know if it helped

Please or to participate in this conversation.