Download the PHP package tediscript/laravel-view-generator without Composer
On this page you can find all versions of the php package tediscript/laravel-view-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tediscript/laravel-view-generator
More information about tediscript/laravel-view-generator
Files in tediscript/laravel-view-generator
Package laravel-view-generator
Short Description Laravel module to generate view from artisan command
License MIT
Informations about the package laravel-view-generator
laravel-view-generator
Laravel module to generate view from artisan command
Installation via composer
Run command:
Or add this script to your composer.json
and run composer update
Usage
Just like you create model via php artisan.
Make View Command
It will generate file resources/views/view-name.blade.php
using plain.stub
template.
It will generate file resources/views/schools/edit.blade.php
using edit.stub
template.
- argument
schools.edit
is the path name of blade file (just like view name in render) - option
--model=School
is the model name. It is optional. Default model name isItem
- option
--layout=edit
is used to specify the view stub file. The option arecreate
,edit
,index
,plain
,show
. The default value isplain
Create your own layout template
You can create your own stub file inside folder resources/stubs
.
For example create file resources/stubs/welcome.stub
then you can call artisan command:
It will generate file resources/views/awesome.blade.php
using welcome.stub
layout.
The supported variable to render are:
{{ model }}
we get it from option--model
{{ pluralModel }}
we get it from pluralize ofmodel
{{ resourceName }}
we get it from lower case ofpluralModel
{{ instanceModel }}
we get it from camel case ofmodel
{{ instanceCollectionModel }}
we get it from pluralize ofinstanceModel
Thats it.
All versions of laravel-view-generator with dependencies
illuminate/filesystem Version ^8.42
illuminate/support Version ^8.42
illuminate/validation Version ^8.42