blog-contest-may-mayhem
blog-contest-may-mayhem copied to clipboard
Laravel CRUD generator from scratch
https://medium.com/@devlob/laravel-crud-generators-614caddf8bea
不错的文章
Thank you @hellowords :+1: :)
I think that I will work on this and make it a full-rich library. Something similar to what Visual Studio offers :/
Exactly what I wanted. Thanks!
@JeyKeu would you like this as a full package?
Some features will include:
- Basic architecture setup, which is the usual way of using Eloquent directly inside your controllers
- Laravel agnostic setup, a more advanced architecture where interfaces are used in order to have your controllers dry and you can easily move them to a new project, etc.
- API controller - Base controller (that includes views)
- Create relationships according to the fields you pass
- All the stubs will be editable, which means that you can change them to your likes in case you don't like something.
etc.
@devlob a package would be great. something that's unobtrusive.
Got it :)
I have try it, but I have faced error. Symfony\Component\Debug\Exception\FatalThrowableError : Class 'App\Console\Commands\File' not found
at /var/www/html/Contest/app/Console/Commands/CrudGenerator.php:92 88| $this->controller($name); 89| $this->model($name); 90| $this->request($name); 91|
92| File::append(base_path('routes/api.php'), 'Route::resource('' . str_plural(strtolower($name)) . "', '{$name}Controller');"); 93| } 94| } 95|