11# Blueprint
22
3- [ ![ Blueprint] ( https://img.shields.io/badge/Blueprint-crud-blue.svg?style=flat-square )] ( https://packagist.org/packages/phpjuice/blueprint )
4- [ ![ Latest Stable Version] ( https://poser.pugx.org/phpjuice/blueprint/v/stable?format=flat-square )] ( https://packagist.org/packages/phpjuice/blueprint )
5- [ ![ Total Downloads] ( https://img.shields.io/packagist/dt/phpjuice/blueprint.svg?style=flat-square )] ( https://packagist.org/packages/phpjuice/blueprint )
6- [ ![ StyleCI] ( https://github.styleci.io/repos/160396575/shield?branch=master )] ( https://github.styleci.io/repos/160396575 )
7- [ ![ GitHub] ( https://img.shields.io/github/license/phpjuice/blueprint.svg?style=flat-square )] ( https://github.com/PHPJuice/Blueprint/blob/master/LICENSE )
3+ [ ![ Latest Stable Version] ( https://poser.pugx.org/phpjuice/blueprint/v/stable )] ( https://packagist.org/packages/phpjuice/blueprint )
4+ [ ![ Total Downloads] ( https://poser.pugx.org/phpjuice/blueprint/downloads )] ( https://packagist.org/packages/phpjuice/blueprint )
5+ [ ![ License] ( https://poser.pugx.org/phpjuice/blueprint/license )] ( https://packagist.org/packages/phpjuice/blueprint )
86
97Blueprint is a powerful CRUD generator to speed up the development of your laravel apps.
108
@@ -87,40 +85,40 @@ And here is a basic strucure for a blueprint json file,following laravel's namin
8785
8886``` json
8987{
90- "crud" : {
91- "name" : " Post" ,
92- "namespace" : " Posts" ,
93- "isApi" : true
94- },
95- "controller" : {
96- "name" : " PostsController" ,
97- "pagination" : 10 ,
98- "validations" : []
99- },
100- "model" : {
101- "name" : " Post" ,
102- "fillable" : " " ,
103- "hidden" : " " ,
104- "softDeletes" : false ,
105- "relationships" : []
106- },
107- "table" : {
108- "name" : " posts" ,
109- "schema" : {
110- "fields" : [],
111- "keys" : {
112- "primary" : " id" ,
113- "foreign" : [],
114- "indexes" : []
115- },
116- "softDeletes" : false
88+ "crud" : {
89+ "name" : " Post" ,
90+ "namespace" : " Posts" ,
91+ "isApi" : true
92+ },
93+ "controller" : {
94+ "name" : " PostsController" ,
95+ "pagination" : 10 ,
96+ "validations" : []
97+ },
98+ "model" : {
99+ "name" : " Post" ,
100+ "fillable" : " " ,
101+ "hidden" : " " ,
102+ "softDeletes" : false ,
103+ "relationships" : []
104+ },
105+ "table" : {
106+ "name" : " posts" ,
107+ "schema" : {
108+ "fields" : [],
109+ "keys" : {
110+ "primary" : " id" ,
111+ "foreign" : [],
112+ "indexes" : []
113+ },
114+ "softDeletes" : false
115+ }
116+ },
117+ "route" : {
118+ "name" : " posts" ,
119+ "url" : " posts" ,
120+ "middlewares" : []
117121 }
118- },
119- "route" : {
120- "name" : " posts" ,
121- "url" : " posts" ,
122- "middlewares" : []
123- }
124122}
125123```
126124
@@ -142,12 +140,12 @@ php artisan blueprint:generate Post
142140
143141After running this command a the following files will be generated :
144142
145- - Controller
146- - Model
147- - Request
148- - Response
149- - Migration
150- - Test
143+ - Controller
144+ - Model
145+ - Request
146+ - Response
147+ - Migration
148+ - Test
151149
152150And by default, the generator will attempt to append the crud route to your Route file. following this snippet
153151` Route::apiResource('route-name', 'controller-name'); `
@@ -164,84 +162,84 @@ php artisan migrate
164162
165163``` json
166164{
167- "crud" : {
168- "name" : " Post" ,
169- "namespace" : " Content" ,
170- "isApi" : true
171- },
172- "controller" : {
173- "name" : " PostsController" ,
174- "namespace" : " Content" ,
175- "pagination" : 10 ,
176- "validations" : [
177- {
178- "field" : " title" ,
179- "rules" : " required|min:5|unique:posts"
180- },
181- {
182- "field" : " content" ,
183- "rules" : " required|min:5"
184- }
185- ]
186- },
187- "model" : {
188- "name" : " Post" ,
189- "namespace" : " Content" ,
190- "fillable" : " title,content" ,
191- "hidden" : " user_id" ,
192- "softDeletes" : true ,
193- "relationships" : [
194- {
195- "name" : " user" ,
196- "type" : " belongsTo" ,
197- "class" : " App\\ User"
198- }
199- ]
200- },
201- "table" : {
202- "name" : " posts" ,
203- "schema" : {
204- "fields" : [
205- {
206- "name" : " title" ,
207- "type" : " string"
208- },
209- {
210- "name" : " content" ,
211- "type" : " text"
212- }
213- ],
214- "keys" : {
215- "primary" : " id" ,
216- "foreign" : [
217- {
218- "column" : " user_id" ,
219- "references" : " id" ,
220- "on" : " users" ,
221- "onDelete" : " cascade" ,
222- "onUpdate" : " cascade"
223- }
224- ],
225- "indexes" : [
226- {
227- "field" : " title" ,
228- "type" : " unique"
229- },
230- {
231- "field" : " title" ,
232- "type" : " index"
233- }
165+ "crud" : {
166+ "name" : " Post" ,
167+ "namespace" : " Content" ,
168+ "isApi" : true
169+ },
170+ "controller" : {
171+ "name" : " PostsController" ,
172+ "namespace" : " Content" ,
173+ "pagination" : 10 ,
174+ "validations" : [
175+ {
176+ "field" : " title" ,
177+ "rules" : " required|min:5|unique:posts"
178+ },
179+ {
180+ "field" : " content" ,
181+ "rules" : " required|min:5"
182+ }
234183 ]
235- },
236- "softDeletes" : true
184+ },
185+ "model" : {
186+ "name" : " Post" ,
187+ "namespace" : " Content" ,
188+ "fillable" : " title,content" ,
189+ "hidden" : " user_id" ,
190+ "softDeletes" : true ,
191+ "relationships" : [
192+ {
193+ "name" : " user" ,
194+ "type" : " belongsTo" ,
195+ "class" : " App\\ User"
196+ }
197+ ]
198+ },
199+ "table" : {
200+ "name" : " posts" ,
201+ "schema" : {
202+ "fields" : [
203+ {
204+ "name" : " title" ,
205+ "type" : " string"
206+ },
207+ {
208+ "name" : " content" ,
209+ "type" : " text"
210+ }
211+ ],
212+ "keys" : {
213+ "primary" : " id" ,
214+ "foreign" : [
215+ {
216+ "column" : " user_id" ,
217+ "references" : " id" ,
218+ "on" : " users" ,
219+ "onDelete" : " cascade" ,
220+ "onUpdate" : " cascade"
221+ }
222+ ],
223+ "indexes" : [
224+ {
225+ "field" : " title" ,
226+ "type" : " unique"
227+ },
228+ {
229+ "field" : " title" ,
230+ "type" : " index"
231+ }
232+ ]
233+ },
234+ "softDeletes" : true
235+ }
236+ },
237+ "route" : {
238+ "name" : " posts" ,
239+ "namespace" : " Posts" ,
240+ "url" : " posts" ,
241+ "middlewares" : []
237242 }
238- },
239- "route" : {
240- "name" : " posts" ,
241- "namespace" : " Posts" ,
242- "url" : " posts" ,
243- "middlewares" : []
244- }
245243}
246244```
247245
@@ -259,14 +257,12 @@ If you discover any security related issues, please email author instead of usin
259257
260258## Credits
261259
262- - [ AppzCoder] ( https://github.com/appzcoder/crud-generator )
260+ - [ AppzCoder] ( https://github.com/appzcoder/crud-generator )
263261
264262## License
265263
266264license. Please see the [ license file] ( LICENCE ) for more information.
267265
268- [ ![ Blueprint] ( https://img.shields.io/badge/Blueprint-crud-blue.svg?style=flat-square )] ( https://packagist.org/packages/phpjuice/blueprint )
269- [ ![ Latest Stable Version] ( https://poser.pugx.org/phpjuice/blueprint/v/stable?format=flat-square )] ( https://packagist.org/packages/phpjuice/blueprint )
270- [ ![ Total Downloads] ( https://img.shields.io/packagist/dt/phpjuice/blueprint.svg?style=flat-square )] ( https://packagist.org/packages/phpjuice/blueprint )
271- [ ![ StyleCI] ( https://github.styleci.io/repos/160396575/shield?branch=master )] ( https://github.styleci.io/repos/160396575 )
272- [ ![ GitHub] ( https://img.shields.io/github/license/phpjuice/blueprint.svg?style=flat-square )] ( https://github.com/PHPJuice/Blueprint/blob/master/LICENSE )
266+ [ ![ Latest Stable Version] ( https://poser.pugx.org/phpjuice/blueprint/v/stable )] ( https://packagist.org/packages/phpjuice/blueprint )
267+ [ ![ Total Downloads] ( https://poser.pugx.org/phpjuice/blueprint/downloads )] ( https://packagist.org/packages/phpjuice/blueprint )
268+ [ ![ License] ( https://poser.pugx.org/phpjuice/blueprint/license )] ( https://packagist.org/packages/phpjuice/blueprint )
0 commit comments