Hi Laravel developers!
I've recently created a new package designed to radically speed up your Laravel application development by generating routes, controllers, models, migrations, factories, requests, resources, and tests - all using a single command.
Quick Example
Let's generate a complete CRUD API for the Post model:
php artisan crud:generate Content/Post \
--template=api \
--fields="title:string,content:text,published_at:datetime,category:belongsTo,comments:hasMany,status:enum:PublishStatus" \
--options="scope:user"
The above command generates the following fully functional files:
app/Http/Controllers/Api/Content/PostController.phpapp/Models/Content/Post.phpapp/Policies/PostPolicy.phpapp/Http/Requests/Content/StorePostRequest.phpapp/Http/Requests/Content/UpdatePostRequest.phpapp/Http/Resources/Content/PostResource.phpdatabase/migrations/{timestamp}_create_posts_table.php-
database/migrations/{timestamp}_create_{pivot}_tables.php(if belongsToMany or morphToMany relationships are present) database/factories/Content/PostFactory.phptests/Feature/Api/Content/PostControllerTest.php- API routes automatically added to
routes/api.php(will runinstall:apiif the file doesn't exist yet) - Laravel Pint run on all generated files
Check it out
๐ Package: jcsoriano/laravel-crud-templates
๐ Documentation: laravelcrudtemplates.com
๐ GitHub: github.com/jcsoriano/laravel-crud-templates
3-minute demo
Top comments (0)