</code></pre></td></tr></table></div></div><h2id=api-crud-feature-with-tests>API CRUD feature with tests</h2><divclass=highlight><divclass=chroma><tableclass=lntable><tr><tdclass=lntd><preclass=chroma><code><spanclass=lnt>1
var lib=JSON.parse("null");if(lib&&lib.includes('mermaid')){var themeVariant=localStorage.getItem('theme')||'light';if(themeVariant==="dark"){mermaid.initialize({theme:'dark'});}else{mermaid.initialize({theme:'default'});}
@ -3,7 +3,7 @@ With this package installed on local environment, we can use (e.g.) php artisan
App\Models\Vehicle.php eloquent model xxx_create_vehicles_table.php migration file VehicleController.php index.blade.php and forms.</description></item><item><title>How to install</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-install/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-install/</guid><description>How to install For Laravel 8.x 1 2 # Get the package $ composer require luthfi/simple-crud-generator:^2.0 For Laravel 5.6 to 7.x 1 2 # Get the package $ composer require luthfi/simple-crud-generator:^1.0 For Laravel 5.5 To use this package on laravel 5.5, we need to add the package (with browserkit) within require-dev in composer.json file, like so :
1 2 3 4 5 # Install required package for laravel/browser-kit-testing $ composer require symfony/css-selector:^3.</description></item><item><title>How to use</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-use/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-use/</guid><description>How to use Just type in terminal $ php artisan make:crud ModelName command, it will create simple Laravel CRUD files of given model name completed with tests.
For example we want to create CRUD for &lsquo;App\Models\Vehicle&rsquo; model.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 $ php artisan make:crud-simple Vehicle Vehicle resource route generated on routes/web.php. Vehicle model generated. Vehicle table migration generated.</description></item><item><title>Available Commands</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/available-commands/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/available-commands/</guid><description>Available Commands Bootstrap 4 Views Full CRUD feature with tests 1 $ php artisan make:crud ModelName Simple CRUD feature with tests 1 $ php artisan make:crud-simple ModelName Bootstrap 3 views Full CRUD feature with tests 1 $ php artisan make:crud ModelName --bs3 Simple CRUD feature with tests 1 $ php artisan make:crud-simple ModelName --bs3 API CRUD feature with tests 1 $ php artisan make:crud-api ModelName</description></item><item><title>Model Attribute/Column</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/model-attributes/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/model-attributes/</guid><description>Model Attribute/Column The Model and table will only have 2 pre-definded attributes or columns : title and description on each generated model and database table. You can continue working on other column on the table.</description></item><item><title>Views</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/views/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/views/</guid><description>Views Bootstrap 4 Views The generated view files use Bootstrap 4 by default (for Laravel 5.6 and later).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 $ php artisan make:crud-simple Vehicle Vehicle resource route generated on routes/web.php. Vehicle model generated. Vehicle table migration generated.</description></item><item><title>Available Commands</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/available-commands/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/available-commands/</guid><description>Available Commands Bootstrap 4 Views Full CRUD feature with tests 1 $ php artisan make:crud ModelName Simple CRUD feature with tests 1 $ php artisan make:crud-simple ModelName Bootstrap 3 views Full CRUD feature with tests 1 $ php artisan make:crud ModelName --bs3 Simple CRUD feature with tests 1 $ php artisan make:crud-simple ModelName --bs3 API CRUD feature with tests 1 $ php artisan make:crud-api ModelName CRUD feature with UUID primary key 1 $ php artisan make:crud ModelName --uuid</description></item><item><title>Model Attribute/Column</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/model-attributes/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/model-attributes/</guid><description>Model Attribute/Column The Model and table will only have 2 pre-definded attributes or columns : title and description on each generated model and database table. You can continue working on other column on the table.</description></item><item><title>Views</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/views/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/views/</guid><description>Views Bootstrap 4 Views The generated view files use Bootstrap 4 by default (for Laravel 5.6 and later).
Bootstrap 3 Views We can also generates views that use Bootstrap 3 with --bs3 command option, eg for Laravel version 5.5.
The Default Layout View You need a resources/views/layouts/app.blade.php view file, simply create one with php artisan make:auth command. You can change this configuration via the config/simple-crud.php file.</description></item><item><title>For API</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/for-api/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/for-api/</guid><description>For API If we want to generate API Controller with feature tests, we use following command :
1 $ php artisan make:crud-api Vehicle By default, we use Laravel Token Based Authentication, so we need to update our user model.
@ -3,7 +3,7 @@ With this package installed on local environment, we can use (e.g.) php artisan
App\Models\Vehicle.php eloquent model xxx_create_vehicles_table.php migration file VehicleController.php index.blade.php and forms.</description></item><item><title>How to install</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-install/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-install/</guid><description>How to install For Laravel 8.x 1 2 # Get the package $ composer require luthfi/simple-crud-generator:^2.0 For Laravel 5.6 to 7.x 1 2 # Get the package $ composer require luthfi/simple-crud-generator:^1.0 For Laravel 5.5 To use this package on laravel 5.5, we need to add the package (with browserkit) within require-dev in composer.json file, like so :
1 2 3 4 5 # Install required package for laravel/browser-kit-testing $ composer require symfony/css-selector:^3.</description></item><item><title>How to use</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-use/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-use/</guid><description>How to use Just type in terminal $ php artisan make:crud ModelName command, it will create simple Laravel CRUD files of given model name completed with tests.
For example we want to create CRUD for &lsquo;App\Models\Vehicle&rsquo; model.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 $ php artisan make:crud-simple Vehicle Vehicle resource route generated on routes/web.php. Vehicle model generated. Vehicle table migration generated.</description></item><item><title>Available Commands</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/available-commands/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/available-commands/</guid><description>Available Commands Bootstrap 4 Views Full CRUD feature with tests 1 $ php artisan make:crud ModelName Simple CRUD feature with tests 1 $ php artisan make:crud-simple ModelName Bootstrap 3 views Full CRUD feature with tests 1 $ php artisan make:crud ModelName --bs3 Simple CRUD feature with tests 1 $ php artisan make:crud-simple ModelName --bs3 API CRUD feature with tests 1 $ php artisan make:crud-api ModelName</description></item><item><title>Model Attribute/Column</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/model-attributes/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/model-attributes/</guid><description>Model Attribute/Column The Model and table will only have 2 pre-definded attributes or columns : title and description on each generated model and database table. You can continue working on other column on the table.</description></item><item><title>Views</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/views/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/views/</guid><description>Views Bootstrap 4 Views The generated view files use Bootstrap 4 by default (for Laravel 5.6 and later).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 $ php artisan make:crud-simple Vehicle Vehicle resource route generated on routes/web.php. Vehicle model generated. Vehicle table migration generated.</description></item><item><title>Available Commands</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/available-commands/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/available-commands/</guid><description>Available Commands Bootstrap 4 Views Full CRUD feature with tests 1 $ php artisan make:crud ModelName Simple CRUD feature with tests 1 $ php artisan make:crud-simple ModelName Bootstrap 3 views Full CRUD feature with tests 1 $ php artisan make:crud ModelName --bs3 Simple CRUD feature with tests 1 $ php artisan make:crud-simple ModelName --bs3 API CRUD feature with tests 1 $ php artisan make:crud-api ModelName CRUD feature with UUID primary key 1 $ php artisan make:crud ModelName --uuid</description></item><item><title>Model Attribute/Column</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/model-attributes/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/model-attributes/</guid><description>Model Attribute/Column The Model and table will only have 2 pre-definded attributes or columns : title and description on each generated model and database table. You can continue working on other column on the table.</description></item><item><title>Views</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/views/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/views/</guid><description>Views Bootstrap 4 Views The generated view files use Bootstrap 4 by default (for Laravel 5.6 and later).
Bootstrap 3 Views We can also generates views that use Bootstrap 3 with --bs3 command option, eg for Laravel version 5.5.
The Default Layout View You need a resources/views/layouts/app.blade.php view file, simply create one with php artisan make:auth command. You can change this configuration via the config/simple-crud.php file.</description></item><item><title>For API</title><link>https://nafiesl.github.io/SimpleCrudGenerator/docs/for-api/</link><pubDate>Sat, 30 Jan 2021 21:00:00 +0800</pubDate><guid>https://nafiesl.github.io/SimpleCrudGenerator/docs/for-api/</guid><description>For API If we want to generate API Controller with feature tests, we use following command :
1 $ php artisan make:crud-api Vehicle By default, we use Laravel Token Based Authentication, so we need to update our user model.