master

laravel/framework

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

Artisan.php

TLDR

This file is a part of the Illuminate\Support\Facades namespace in the Laravel framework. It contains the Artisan class, which is a facade for the ConsoleKernelContract interface. The Artisan class provides static methods for interacting with the Laravel Artisan command-line interface.

Methods

handle

This method handles the given input and output for the Artisan command-line interface.

terminate

This method terminates the Artisan command-line interface with the provided status.

whenCommandLifecycleIsLongerThan

This method sets a callback to be executed when the command lifecycle (start to end) is longer than the threshold provided.

commandStartedAt

This method returns the start time of the current command.

resolveConsoleSchedule

This method resolves the console schedule for the current application.

command

This method registers a new closure-based command with the given signature and callback.

registerCommand

This method registers a new command instance.

call

This method calls an Artisan command with the specified command and parameters.

queue

This method queues a command for later execution.

all

This method returns all registered commands.

output

This method returns the output of the last command.

bootstrap

This method boots the application and initializes the Artisan command-line interface.

bootstrapWithoutBootingProviders

This method boots the application without booting the service providers.

setArtisan

This method sets the Artisan instance.

addCommands

This method adds an array of commands to the application.

addCommandPaths

This method adds an array of command paths to the application.

addCommandRoutePaths

This method adds an array of command route paths to the application.

Classes

This file does not contain any additional classes.

<?php

namespace Illuminate\Support\Facades;

use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract;

/**
 * @method static int handle(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface|null $output = null)
 * @method static void terminate(\Symfony\Component\Console\Input\InputInterface $input, int $status)
 * @method static void whenCommandLifecycleIsLongerThan(\DateTimeInterface|\Carbon\CarbonInterval|float|int $threshold, callable $handler)
 * @method static \Illuminate\Support\Carbon|null commandStartedAt()
 * @method static \Illuminate\Console\Scheduling\Schedule resolveConsoleSchedule()
 * @method static \Illuminate\Foundation\Console\ClosureCommand command(string $signature, \Closure $callback)
 * @method static void registerCommand(\Symfony\Component\Console\Command\Command $command)
 * @method static int call(string $command, array $parameters = [], \Symfony\Component\Console\Output\OutputInterface|null $outputBuffer = null)
 * @method static \Illuminate\Foundation\Bus\PendingDispatch queue(string $command, array $parameters = [])
 * @method static array all()
 * @method static string output()
 * @method static void bootstrap()
 * @method static void bootstrapWithoutBootingProviders()
 * @method static void setArtisan(\Illuminate\Console\Application|null $artisan)
 * @method static \Illuminate\Foundation\Console\Kernel addCommands(array $commands)
 * @method static \Illuminate\Foundation\Console\Kernel addCommandPaths(array $paths)
 * @method static \Illuminate\Foundation\Console\Kernel addCommandRoutePaths(array $paths)
 *
 * @see \Illuminate\Foundation\Console\Kernel
 */
class Artisan extends Facade
{
    /**
     * Get the registered name of the component.
     *
     * @return string
     */
    protected static function getFacadeAccessor()
    {
        return ConsoleKernelContract::class;
    }
}