欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

每天laravel-20160725| Genaerator command-2

程序员文章站 2024-01-29 12:10:46
...
/** * Get the stub file for the generator. * * @return string */abstract protected function getStub();//Get the stub file for the generator/** * Execute the console command. * * @return bool|null */public function fire()//Execute the console command{    $name = $this->parseName($this->getNameInput());// $name use a function to parse it and use a function to get Input name    $path = $this->getPath($name);// from the name get path ,    if ($this->alreadyExists($this->getNameInput())) {// if know the name        $this->error($this->type.' already exists!');        return false;    }// tell the false messages    $this->makeDirectory($path);// make dir    $this->files->put($path, $this->buildClass($name));// put file to the path    $this->info($this->type.' created successfully.');// write log.}