Skip to content

Artisan command to generate models, views, controllers and validation from your database.

License

Notifications You must be signed in to change notification settings

morganrowse/laravelcrud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel CRUD

Downloads Version Travis Codacy grade

This composer package adds artisan commands which create Models, Views, Controllers and Request Validation for crud operation based off of a database table schema.

Installation

Subheader Image

First add the package via composer

$ composer require morganrowse/laravelcrud dev-master

Use dev-master as I currently don't push tags

Usage

Subheader Image

First have your database setup as desired following laravel naming convention (such as a table called posts).

Next run the command via artisan

$ php artisan make:crud posts

This will create:

app
│   Post.php
└───Http
│   └───Controllers
│   │   │   PostController.php
│   |   └───View
│   │   │   |   PostController.php
│   └───Requests
│   │   └───Post
│   │   │   │   DestroyPost.php
│   │   │   │   StorePost.php
│   │   │   │   UpdatePost.php
│   └───Resources
│   │   │   PostResource.php
resources
└───views
│   └───posts
│   │   │   create.blade.php
│   │   │   edit.blade.php
│   │   │   index.blade.php
│   │   │   show.blade.php

Now add the view routes to your web.php

...
Route::resource('posts','View\\PostController');
...

Finally add the api routes to your api.php

...
Route::apiResource('posts','PostController');
...

Subheader Image

About

Artisan command to generate models, views, controllers and validation from your database.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published