master

laravel/framework

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

EnvironmentCommand.php

TLDR

This file contains the EnvironmentCommand class, which extends the Command class and is used to display the current framework environment.

Classes

EnvironmentCommand

The EnvironmentCommand class is a console command that displays the current framework environment. It extends the Command class and is used to retrieve and output the current environment.

Methods

This file does not contain any additional methods.

<?php

namespace Illuminate\Foundation\Console;

use Illuminate\Console\Command;
use Symfony\Component\Console\Attribute\AsCommand;

#[AsCommand(name: 'env')]
class EnvironmentCommand extends Command
{
    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'env';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Display the current framework environment';

    /**
     * Execute the console command.
     *
     * @return void
     */
    public function handle()
    {
        $this->components->info(sprintf(
            'The application environment is [%s].',
            $this->laravel['env'],
        ));
    }
}