morganrowse / laravelcrud by morganrowse

Artisan command to generate routing, views and controllers from a database table
88
2
1
Package Data
Maintainer Username: morganrowse
Maintainer Contact: morgan.rowse@gmail.com (Morgan Rowse)
Package Create Date: 2017-07-14
Package Last Update: 2018-07-30
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-21 03:00:20
Package Statistics
Total Downloads: 88
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 2
Total Watchers: 1
Total Forks: 0
Total Open Issues: 1

Laravel CRUD

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