main

filamentphp/demo

Last updated at: 29/12/2023 09:42

Kernel.php

TLDR

This file is the Kernel class in the app/Console directory of the Demo Projects project. It extends the ConsoleKernel class and is responsible for defining the application's command schedule and registering commands for the application.

Methods

schedule

This method defines the application's command schedule. It takes in a Schedule instance as a parameter.

commands

This method registers the commands for the application. It loads the commands from the Commands directory and includes the console.php routes file.

<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * Define the application's command schedule.
     *
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        //
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__ . '/Commands');

        require base_path('routes/console.php');
    }
}