Skip to content

This package provides an artisan command to generate a basic crud with Restful API support

License

Notifications You must be signed in to change notification settings

nhrrob/crudgenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NHRROB Crud Generator Package

Stars Total Downloads Latest Stable Version GitHub license

This package provides an artisan command to generate a basic crud

composer install command:

composer require nhrrob/crudgenerator

Crud Generator Commands

  • 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
    

Note:

  • 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

Loom Videos:

Modify Stubs:

  • Publish vendor files
php artisan vendor:publish

Remove Crud Generated Files:

  • 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

Bonus

Laravel 8 auth using laravel/ui:

composer require laravel/ui
php artisan ui bootstrap --auth
npm install && npm run dev
php artisan migrate

Bonus : API

API Helpline:

php artisan passport:install

Bonus : Admin File Structure

  • 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

About

This package provides an artisan command to generate a basic crud with Restful API support

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages