如何在laravel 5.5中自定义控制器生成器文件

时间:2017-12-20 14:57:21

标签: laravel

char    *ft_strchr(const char *s, int c) {
    while (*s != (unsigned char) c) {
        if (!*s)
            return NULL;
        s++;}
    return (char *)s;
}

1 个答案:

答案 0 :(得分:0)

你可以这样做,

<?php

namespace App\Console\Commands;

use Illuminate\Routing\Console\ControllerMakeCommand;

class CustomMakeController extends ControllerMakeCommand
{
    // YOUR CUSTOM NAME
    protected $name = 'make:custom-controller';

    // YOUR CUSTOM STUB FILE
    /**
     * @return string
     */
    protected function getStub()
    {
        return STUB_URL;
    }

}

另外,您应该将其注册到App\Console\Kernel.php,如下所示,

protected $commands = [
        Commands\CustomMakeController::class
    ];