A
A
Agelios2019-01-23 14:32:25
Laravel
Agelios, 2019-01-23 14:32:25

Where can I find options for ControllerMakeCommand?

The laravel doc says that when creating a console command, you can specify additional options. For example In turn shows many options for the controller. If you go into the ControllerMakeCommand code (namespace Illuminate\Routing\Console;), there are no options there, as for all such classes. Where are they and how does Laravel understand who needs which options?
protected $name = 'make:somethink --youroption=';
php artisan help make:controller

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Wells, 2019-01-23
@Agelios

How is it not? Everything is:

/**
     * Get the console command options.
     *
     * @return array
     */
    protected function getOptions()
    {
        return [
            ['model', 'm', InputOption::VALUE_OPTIONAL, 'Generate a resource controller for the given model.'],
            ['resource', 'r', InputOption::VALUE_NONE, 'Generate a resource controller class.'],
            ['invokable', 'i', InputOption::VALUE_NONE, 'Generate a single method, invokable controller class.'],
            ['parent', 'p', InputOption::VALUE_OPTIONAL, 'Generate a nested resource controller class.'],
            ['api', null, InputOption::VALUE_NONE, 'Exclude the create and edit methods from the controller.'],
        ];
    }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question