Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel package console command

public function boot()
    {
        
        if ($this->app->runningInConsole()) {
            
            $this->commands([
                PackageCommandClassNameHere::class,
            ]);

            $this->app->booted(function () {
                $schedule = $this->app->make(Schedule::class);
                $schedule->command('signature:command')->everyTwoHours();
            });
        }
    }
 
PREVIOUS NEXT
Tagged: #laravel #package #console #command
ADD COMMENT
Topic
Name
3+4 =