composer install command:
composer require nhrrob/crudgenerator
- install:
php artisan crud:generator
- If you want to keep backend files under Admin folder
File Structure: Check below (Section => Bonus : Admin File Structure)
php artisan crud:generator --admin
- Migration: Add title field and run migration
- add field:
$table->string('title');
- run migration:
php artisan migrate
- This package creates resource route.
Example:
- Model title: Post
- Resource route: example.com/posts
- If you want to use Api, make sure Passport is installed.
Link: https://github.com/nhrrob/laravelwiki
-
Laravel 8 project installation with auth:
https://www.loom.com/share/681f186c6f61490f8e2df97cfc86afdd -
Laravel Crud using nhrrob/crudgenerator:
https://www.loom.com/share/b860fb8c3ad2406fbd8661f2946f5cd7
- Publish vendor files
php artisan vendor:publish
- Delete Crud
php artisan crud:generator:delete
- If you have generated crud under Admin folder:
php artisan crud:generator:delete --admin
- Manually delete migration file and remove route from web.php
Feel free to contact:
nazmulrobin.com | Twitter | Linkedin | Email
composer require laravel/ui
php artisan ui bootstrap --auth
npm install && npm run dev
php artisan migrate
API Helpline:
https://github.com/nhrrob/laravelwiki
After refreshing database re create personal access token for passport
php artisan passport:install
-
When you add --admin in crud generator commands =>
It adds admin folder for views and Admin folder for controllers (including Api) -
Sample File/Folder Structure:
#Controllers
app/Http/Controllers/
app/Http/Controllers/Admin
#Views
resources/views/
resources/views/admin
------------------------------
#API Controllers
app/Http/Controllers/Api
app/Http/Controllers/Api/Admin