From 03ec77dca984302bfdb339aaeafd8aab32ecfeb7 Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Sat, 30 Jan 2021 22:15:53 +0800 Subject: [PATCH] Update some site config --- 404.html | 6 +++--- docs/about/index.html | 8 ++++---- docs/available-commands/index.html | 8 ++++---- docs/config-file/index.html | 8 ++++---- docs/for-api/index.html | 8 ++++---- docs/generated-testing-suite/index.html | 8 ++++---- docs/how-to-install/index.html | 8 ++++---- docs/how-to-use/index.html | 8 ++++---- docs/index.html | 12 ++++++------ docs/index.xml | 2 +- docs/license/index.html | 8 ++++---- docs/model-attributes/index.html | 8 ++++---- docs/publishing-the-stub-files/index.html | 8 ++++---- docs/screenshots/index.html | 8 ++++---- docs/views/index.html | 8 ++++---- index.html | 8 ++++---- index.xml | 2 +- 17 files changed, 63 insertions(+), 63 deletions(-) diff --git a/404.html b/404.html index ad7bc38..8dd15e6 100644 --- a/404.html +++ b/404.html @@ -78,10 +78,10 @@ items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIn items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIndex].offsetTop+items[activeIndex].clientHeight-searchContainerMaxHeight;if(overflowedPixel<0){document.querySelector(".search-content").scrollTop-=items[activeIndex].getBoundingClientRect().height;}else{document.querySelector(".search-content").scrollTop=overflowedPixel+items[activeIndex].getBoundingClientRect().height;}}else if(e.key==='Enter'){var currentItemLink=items[activeIndex].getAttribute('href');if(currentItemLink){location.href=currentItemLink;}}else if(e.key==='Escape'){e.target.value=null;if(searchResults){searchResults.classList.remove('is-active');}}}):null;searchMobile?searchMobile.addEventListener('input',function(e){if(!e.target.value){let wrap=document.getElementById('search-mobile-results');while(wrap.firstChild){wrap.removeChild(wrap.firstChild);} return null;} searchText=e.target.value;var results=fuse.search(e.target.value);if(enableSearchHighlight){renderSearchHighlightResultsMobile(searchText,results);}else{renderSearchResultsMobile(searchText,results);} -var dropdownItems=searchResultsContainer.querySelectorAll('.dd-item');dropdownItems?dropdownItems.forEach(function(item){item.addEventListener('mousedown',function(e){e.target.click();});}):null;}):null;}
Page not found
\ No newline at end of file +
Page not found
\ No newline at end of file diff --git a/docs/about/index.html b/docs/about/index.html index 363fb9f..a63a0b4 100644 --- a/docs/about/index.html +++ b/docs/about/index.html @@ -78,13 +78,13 @@ items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIn items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIndex].offsetTop+items[activeIndex].clientHeight-searchContainerMaxHeight;if(overflowedPixel<0){document.querySelector(".search-content").scrollTop-=items[activeIndex].getBoundingClientRect().height;}else{document.querySelector(".search-content").scrollTop=overflowedPixel+items[activeIndex].getBoundingClientRect().height;}}else if(e.key==='Enter'){var currentItemLink=items[activeIndex].getAttribute('href');if(currentItemLink){location.href=currentItemLink;}}else if(e.key==='Escape'){e.target.value=null;if(searchResults){searchResults.classList.remove('is-active');}}}):null;searchMobile?searchMobile.addEventListener('input',function(e){if(!e.target.value){let wrap=document.getElementById('search-mobile-results');while(wrap.firstChild){wrap.removeChild(wrap.firstChild);} return null;} searchText=e.target.value;var results=fuse.search(e.target.value);if(enableSearchHighlight){renderSearchHighlightResultsMobile(searchText,results);}else{renderSearchResultsMobile(searchText,results);} -var dropdownItems=searchResultsContainer.querySelectorAll('.dd-item');dropdownItems?dropdownItems.forEach(function(item){item.addEventListener('mousedown',function(e){e.target.click();});}):null;}):null;}

About this package

About this package

About this package

This package contains artisan make:crud commands to create a simple CRUD feature with test classes on our Laravel 5.5 (and later) application. This package is fairly simple, to boost test-driven development method on our laravel application.

With this package installed on local environment, we can use (e.g.) php artisan make:crud Vehicle command to generate some files :

  • App\Models\Vehicle.php eloquent model
  • xxx_create_vehicles_table.php migration file
  • VehicleController.php
  • index.blade.php and forms.blade.php view file in resources/views/vehicles directory
  • resources/lang/vehicle.php lang file
  • VehicleFactory.php model factory file
  • VehiclePolicy.php model policy file in app/Policies directory
  • ManageVehiclesTest.php feature test class in tests/Feature directory
  • VehicleTest.php unit test class in tests/Unit/Models directory
  • VehiclePolicyTest.php unit test class in tests/Unit/Policies directory

It will update some file :

  • Update routes/web.php to add vehicles resource route
  • Update app/providers/AuthServiceProvider.php to add Vehicle model Policy class in $policies property

It will also create this file if it not exists :

  • resources/lang/app.php lang file if it not exists
  • tests/BrowserKitTest.php base Feature TestCase class if it not exists

Main purpose

The main purpose of this package is for faster Test-driven Development, it generates model CRUD scaffolds complete with Testing Classes which will use Laravel Browserkit Testing package and PHPUnit.

What's on this Page
\ No newline at end of file +switchElem.className='switch';},}).register("screen and (max-width:600px)",{match:function(){listSide.className='hide';listMain.className='lmr';singleMenu.className='hide';switchElem.className='hide';},unmatch:function(){listSide.className='hide';listMain.className='mr';singleMenu.className='l';switchElem.className='hide';},});
\ No newline at end of file diff --git a/docs/available-commands/index.html b/docs/available-commands/index.html index 5b27eef..5f99511 100644 --- a/docs/available-commands/index.html +++ b/docs/available-commands/index.html @@ -78,13 +78,13 @@ items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIn items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIndex].offsetTop+items[activeIndex].clientHeight-searchContainerMaxHeight;if(overflowedPixel<0){document.querySelector(".search-content").scrollTop-=items[activeIndex].getBoundingClientRect().height;}else{document.querySelector(".search-content").scrollTop=overflowedPixel+items[activeIndex].getBoundingClientRect().height;}}else if(e.key==='Enter'){var currentItemLink=items[activeIndex].getAttribute('href');if(currentItemLink){location.href=currentItemLink;}}else if(e.key==='Escape'){e.target.value=null;if(searchResults){searchResults.classList.remove('is-active');}}}):null;searchMobile?searchMobile.addEventListener('input',function(e){if(!e.target.value){let wrap=document.getElementById('search-mobile-results');while(wrap.firstChild){wrap.removeChild(wrap.firstChild);} return null;} searchText=e.target.value;var results=fuse.search(e.target.value);if(enableSearchHighlight){renderSearchHighlightResultsMobile(searchText,results);}else{renderSearchResultsMobile(searchText,results);} -var dropdownItems=searchResultsContainer.querySelectorAll('.dd-item');dropdownItems?dropdownItems.forEach(function(item){item.addEventListener('mousedown',function(e){e.target.click();});}):null;}):null;}

Available Commands

Available Commands

Available Commands

Bootstrap 4 Views

Full CRUD feature with tests

1
 
$ php artisan make:crud ModelName
 

Simple CRUD feature with tests

1
@@ -111,4 +111,4 @@ jsonContent=x.innerText;var node0=document.createElement('canvas');var source=nu
 if(lib&&lib.includes('viz')){var vizPrefix="language-viz-";Array.prototype.forEach.call(document.querySelectorAll("[class^="+vizPrefix+"]"),function(x){x.style.display='none'
 x.parentNode.style.backgroundColor="transparent"
 var engine;x.getAttribute("class").split(" ").forEach(function(cls){if(cls.startsWith(vizPrefix)){engine=cls.substr(vizPrefix.length);}});var viz=new Viz();viz.renderSVGElement(x.innerText,{engine:engine}).then(function(element){element.style.width="100%";x.parentNode.insertBefore(element,x);})});}});
\ No newline at end of file +switchElem.className='switch';},}).register("screen and (max-width:600px)",{match:function(){listSide.className='hide';listMain.className='lmr';singleMenu.className='hide';switchElem.className='hide';},unmatch:function(){listSide.className='hide';listMain.className='mr';singleMenu.className='l';switchElem.className='hide';},});
\ No newline at end of file diff --git a/docs/config-file/index.html b/docs/config-file/index.html index e0ae5ae..b20aa71 100644 --- a/docs/config-file/index.html +++ b/docs/config-file/index.html @@ -78,13 +78,13 @@ items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIn items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIndex].offsetTop+items[activeIndex].clientHeight-searchContainerMaxHeight;if(overflowedPixel<0){document.querySelector(".search-content").scrollTop-=items[activeIndex].getBoundingClientRect().height;}else{document.querySelector(".search-content").scrollTop=overflowedPixel+items[activeIndex].getBoundingClientRect().height;}}else if(e.key==='Enter'){var currentItemLink=items[activeIndex].getAttribute('href');if(currentItemLink){location.href=currentItemLink;}}else if(e.key==='Escape'){e.target.value=null;if(searchResults){searchResults.classList.remove('is-active');}}}):null;searchMobile?searchMobile.addEventListener('input',function(e){if(!e.target.value){let wrap=document.getElementById('search-mobile-results');while(wrap.firstChild){wrap.removeChild(wrap.firstChild);} return null;} searchText=e.target.value;var results=fuse.search(e.target.value);if(enableSearchHighlight){renderSearchHighlightResultsMobile(searchText,results);}else{renderSearchResultsMobile(searchText,results);} -var dropdownItems=searchResultsContainer.querySelectorAll('.dd-item');dropdownItems?dropdownItems.forEach(function(item){item.addEventListener('mousedown',function(e){e.target.click();});}):null;}):null;}

Config File

Config File

You can configure your own by publishing the config file:

1
 
$ php artisan vendor:publish --provider="Luthfi\CrudGenerator\ServiceProvider" --tag=config
 

That will generate config/simple-crud.php file.

By default, this package have some configuration:

 1
@@ -127,4 +127,4 @@ jsonContent=x.innerText;var node0=document.createElement('canvas');var source=nu
 if(lib&&lib.includes('viz')){var vizPrefix="language-viz-";Array.prototype.forEach.call(document.querySelectorAll("[class^="+vizPrefix+"]"),function(x){x.style.display='none'
 x.parentNode.style.backgroundColor="transparent"
 var engine;x.getAttribute("class").split(" ").forEach(function(cls){if(cls.startsWith(vizPrefix)){engine=cls.substr(vizPrefix.length);}});var viz=new Viz();viz.renderSVGElement(x.innerText,{engine:engine}).then(function(element){element.style.width="100%";x.parentNode.insertBefore(element,x);})});}});
\ No newline at end of file +switchElem.className='switch';},}).register("screen and (max-width:600px)",{match:function(){listSide.className='hide';listMain.className='lmr';singleMenu.className='hide';switchElem.className='hide';},unmatch:function(){listSide.className='hide';listMain.className='mr';singleMenu.className='l';switchElem.className='hide';},});
\ No newline at end of file diff --git a/docs/for-api/index.html b/docs/for-api/index.html index 62b0f88..1d8b1e3 100644 --- a/docs/for-api/index.html +++ b/docs/for-api/index.html @@ -78,13 +78,13 @@ items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIn items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIndex].offsetTop+items[activeIndex].clientHeight-searchContainerMaxHeight;if(overflowedPixel<0){document.querySelector(".search-content").scrollTop-=items[activeIndex].getBoundingClientRect().height;}else{document.querySelector(".search-content").scrollTop=overflowedPixel+items[activeIndex].getBoundingClientRect().height;}}else if(e.key==='Enter'){var currentItemLink=items[activeIndex].getAttribute('href');if(currentItemLink){location.href=currentItemLink;}}else if(e.key==='Escape'){e.target.value=null;if(searchResults){searchResults.classList.remove('is-active');}}}):null;searchMobile?searchMobile.addEventListener('input',function(e){if(!e.target.value){let wrap=document.getElementById('search-mobile-results');while(wrap.firstChild){wrap.removeChild(wrap.firstChild);} return null;} searchText=e.target.value;var results=fuse.search(e.target.value);if(enableSearchHighlight){renderSearchHighlightResultsMobile(searchText,results);}else{renderSearchResultsMobile(searchText,results);} -var dropdownItems=searchResultsContainer.querySelectorAll('.dd-item');dropdownItems?dropdownItems.forEach(function(item){item.addEventListener('mousedown',function(e){e.target.click();});}):null;}):null;}

For API

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.

  1. Add api_token column on our users_table_migration.
  2. Add api_token as fillable property on User model.
  3. Add api_token field on our UserFactory.

API Usage

The generated API is a REST API, using GET and POST verbs, with a URI of /api/modelname.

Example code for calling the generated API, using Guzzle:

// Read data a specific Vehicle record...
@@ -119,4 +119,4 @@ jsonContent=x.innerText;var node0=document.createElement('canvas');var source=nu
 if(lib&&lib.includes('viz')){var vizPrefix="language-viz-";Array.prototype.forEach.call(document.querySelectorAll("[class^="+vizPrefix+"]"),function(x){x.style.display='none'
 x.parentNode.style.backgroundColor="transparent"
 var engine;x.getAttribute("class").split(" ").forEach(function(cls){if(cls.startsWith(vizPrefix)){engine=cls.substr(vizPrefix.length);}});var viz=new Viz();viz.renderSVGElement(x.innerText,{engine:engine}).then(function(element){element.style.width="100%";x.parentNode.insertBefore(element,x);})});}});
\ No newline at end of file +switchElem.className='switch';},}).register("screen and (max-width:600px)",{match:function(){listSide.className='hide';listMain.className='lmr';singleMenu.className='hide';switchElem.className='hide';},unmatch:function(){listSide.className='hide';listMain.className='mr';singleMenu.className='l';switchElem.className='hide';},});
\ No newline at end of file diff --git a/docs/generated-testing-suite/index.html b/docs/generated-testing-suite/index.html index 4e42f67..825d431 100644 --- a/docs/generated-testing-suite/index.html +++ b/docs/generated-testing-suite/index.html @@ -78,13 +78,13 @@ items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIn items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIndex].offsetTop+items[activeIndex].clientHeight-searchContainerMaxHeight;if(overflowedPixel<0){document.querySelector(".search-content").scrollTop-=items[activeIndex].getBoundingClientRect().height;}else{document.querySelector(".search-content").scrollTop=overflowedPixel+items[activeIndex].getBoundingClientRect().height;}}else if(e.key==='Enter'){var currentItemLink=items[activeIndex].getAttribute('href');if(currentItemLink){location.href=currentItemLink;}}else if(e.key==='Escape'){e.target.value=null;if(searchResults){searchResults.classList.remove('is-active');}}}):null;searchMobile?searchMobile.addEventListener('input',function(e){if(!e.target.value){let wrap=document.getElementById('search-mobile-results');while(wrap.firstChild){wrap.removeChild(wrap.firstChild);} return null;} searchText=e.target.value;var results=fuse.search(e.target.value);if(enableSearchHighlight){renderSearchHighlightResultsMobile(searchText,results);}else{renderSearchResultsMobile(searchText,results);} -var dropdownItems=searchResultsContainer.querySelectorAll('.dd-item');dropdownItems?dropdownItems.forEach(function(item){item.addEventListener('mousedown',function(e){e.target.click();});}):null;}):null;}

Generated Testing Suite

Generated Testing Suite

Generated Testing Suite

Next, let us try the generated testing suite. To use the generated testing classes, we can set the database environment using in-memory database SQLite. Open phpunit.xml. Add two lines below on the env :

1
 2
 3
@@ -119,4 +119,4 @@ jsonContent=x.innerText;var node0=document.createElement('canvas');var source=nu
 if(lib&&lib.includes('viz')){var vizPrefix="language-viz-";Array.prototype.forEach.call(document.querySelectorAll("[class^="+vizPrefix+"]"),function(x){x.style.display='none'
 x.parentNode.style.backgroundColor="transparent"
 var engine;x.getAttribute("class").split(" ").forEach(function(cls){if(cls.startsWith(vizPrefix)){engine=cls.substr(vizPrefix.length);}});var viz=new Viz();viz.renderSVGElement(x.innerText,{engine:engine}).then(function(element){element.style.width="100%";x.parentNode.insertBefore(element,x);})});}});
\ No newline at end of file +switchElem.className='switch';},}).register("screen and (max-width:600px)",{match:function(){listSide.className='hide';listMain.className='lmr';singleMenu.className='hide';switchElem.className='hide';},unmatch:function(){listSide.className='hide';listMain.className='mr';singleMenu.className='l';switchElem.className='hide';},});
\ No newline at end of file diff --git a/docs/how-to-install/index.html b/docs/how-to-install/index.html index eadd7ff..7f271fd 100644 --- a/docs/how-to-install/index.html +++ b/docs/how-to-install/index.html @@ -78,13 +78,13 @@ items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIn items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIndex].offsetTop+items[activeIndex].clientHeight-searchContainerMaxHeight;if(overflowedPixel<0){document.querySelector(".search-content").scrollTop-=items[activeIndex].getBoundingClientRect().height;}else{document.querySelector(".search-content").scrollTop=overflowedPixel+items[activeIndex].getBoundingClientRect().height;}}else if(e.key==='Enter'){var currentItemLink=items[activeIndex].getAttribute('href');if(currentItemLink){location.href=currentItemLink;}}else if(e.key==='Escape'){e.target.value=null;if(searchResults){searchResults.classList.remove('is-active');}}}):null;searchMobile?searchMobile.addEventListener('input',function(e){if(!e.target.value){let wrap=document.getElementById('search-mobile-results');while(wrap.firstChild){wrap.removeChild(wrap.firstChild);} return null;} searchText=e.target.value;var results=fuse.search(e.target.value);if(enableSearchHighlight){renderSearchHighlightResultsMobile(searchText,results);}else{renderSearchResultsMobile(searchText,results);} -var dropdownItems=searchResultsContainer.querySelectorAll('.dd-item');dropdownItems?dropdownItems.forEach(function(item){item.addEventListener('mousedown',function(e){e.target.click();});}):null;}):null;}

How to install

How to install

How to install

For Laravel 8.x

1
 2
 
# Get the package
@@ -119,4 +119,4 @@ jsonContent=x.innerText;var node0=document.createElement('canvas');var source=nu
 if(lib&&lib.includes('viz')){var vizPrefix="language-viz-";Array.prototype.forEach.call(document.querySelectorAll("[class^="+vizPrefix+"]"),function(x){x.style.display='none'
 x.parentNode.style.backgroundColor="transparent"
 var engine;x.getAttribute("class").split(" ").forEach(function(cls){if(cls.startsWith(vizPrefix)){engine=cls.substr(vizPrefix.length);}});var viz=new Viz();viz.renderSVGElement(x.innerText,{engine:engine}).then(function(element){element.style.width="100%";x.parentNode.insertBefore(element,x);})});}});
\ No newline at end of file +switchElem.className='switch';},}).register("screen and (max-width:600px)",{match:function(){listSide.className='hide';listMain.className='lmr';singleMenu.className='hide';switchElem.className='hide';},unmatch:function(){listSide.className='hide';listMain.className='mr';singleMenu.className='l';switchElem.className='hide';},});
\ No newline at end of file diff --git a/docs/how-to-use/index.html b/docs/how-to-use/index.html index fe708e6..15cef26 100644 --- a/docs/how-to-use/index.html +++ b/docs/how-to-use/index.html @@ -78,13 +78,13 @@ items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIn items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIndex].offsetTop+items[activeIndex].clientHeight-searchContainerMaxHeight;if(overflowedPixel<0){document.querySelector(".search-content").scrollTop-=items[activeIndex].getBoundingClientRect().height;}else{document.querySelector(".search-content").scrollTop=overflowedPixel+items[activeIndex].getBoundingClientRect().height;}}else if(e.key==='Enter'){var currentItemLink=items[activeIndex].getAttribute('href');if(currentItemLink){location.href=currentItemLink;}}else if(e.key==='Escape'){e.target.value=null;if(searchResults){searchResults.classList.remove('is-active');}}}):null;searchMobile?searchMobile.addEventListener('input',function(e){if(!e.target.value){let wrap=document.getElementById('search-mobile-results');while(wrap.firstChild){wrap.removeChild(wrap.firstChild);} return null;} searchText=e.target.value;var results=fuse.search(e.target.value);if(enableSearchHighlight){renderSearchHighlightResultsMobile(searchText,results);}else{renderSearchResultsMobile(searchText,results);} -var dropdownItems=searchResultsContainer.querySelectorAll('.dd-item');dropdownItems?dropdownItems.forEach(function(item){item.addEventListener('mousedown',function(e){e.target.click();});}):null;}):null;}

How to use

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 ‘App\Models\Vehicle’ model.

 1
  2
  3
@@ -187,4 +187,4 @@ jsonContent=x.innerText;var node0=document.createElement('canvas');var source=nu
 if(lib&&lib.includes('viz')){var vizPrefix="language-viz-";Array.prototype.forEach.call(document.querySelectorAll("[class^="+vizPrefix+"]"),function(x){x.style.display='none'
 x.parentNode.style.backgroundColor="transparent"
 var engine;x.getAttribute("class").split(" ").forEach(function(cls){if(cls.startsWith(vizPrefix)){engine=cls.substr(vizPrefix.length);}});var viz=new Viz();viz.renderSVGElement(x.innerText,{engine:engine}).then(function(element){element.style.width="100%";x.parentNode.insertBefore(element,x);})});}});
\ No newline at end of file +switchElem.className='switch';},}).register("screen and (max-width:600px)",{match:function(){listSide.className='hide';listMain.className='lmr';singleMenu.className='hide';switchElem.className='hide';},unmatch:function(){listSide.className='hide';listMain.className='mr';singleMenu.className='l';switchElem.className='hide';},});
\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index d3b6bda..3889b19 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,4 +1,4 @@ -Simple CRUD Generator – Simple CRUD Generator for Laravel

Simple CRUD Generator

Documentation

Laravel Simple CRUD Generator

Need faster TDD in Laravel project? This is a simple CRUD generator complete with automated testing suite.

About this package
This package contains artisan make:crud commands to create a simple CRUD feature with test classes on our Laravel application.
How to install
Install the package with composer.
How to use
How ot use the package.
Available Commands
Available commands and options.
Model Attribute/Column
Model attributes or column generated by the package.
Views
The generated views are using bootstrap frontend framework.
For API
Generates API endpoints for model CRUD.
Config File
Configure the package with config file.
Publishing the stub files
Use your own stub files.
Screenshots
Some screenshots of the generated CRUD feature.
Generated Testing Suite
Some screenshots of the generated CRUD feature.
License
Some screenshots of the generated CRUD feature.
\ No newline at end of file +switchElem.className='switch';},}).register("screen and (max-width:600px)",{match:function(){listMenu.className='hide';listMain.className='lmr';listSide.className='hide';switchElem.className='hide';},unmatch:function(){listMenu.className='l';listMain.className='mr';listSide.className='hide';switchElem.className='hide';},});
\ No newline at end of file diff --git a/docs/index.xml b/docs/index.xml index d879077..250ac40 100644 --- a/docs/index.xml +++ b/docs/index.xml @@ -1,4 +1,4 @@ -Simple CRUD Generator on Simple CRUD Generator for Laravelhttps://nafiesl.github.io/SimpleCrudGenerator/docs/Recent content in Simple CRUD Generator on Simple CRUD Generator for LaravelHugo -- gohugo.ioenCopyright &copy; 2017 Nafies Luthfi.Sat, 30 Jan 2021 21:00:00 +0800About this packagehttps://nafiesl.github.io/SimpleCrudGenerator/docs/about/Sat, 30 Jan 2021 21:00:00 +0800https://nafiesl.github.io/SimpleCrudGenerator/docs/about/About this package This package contains artisan make:crud commands to create a simple CRUD feature with test classes on our Laravel 5.5 (and later) application. This package is fairly simple, to boost test-driven development method on our laravel application. +Documentation on Simple CRUD Generator for Laravelhttps://nafiesl.github.io/SimpleCrudGenerator/docs/Recent content in Documentation on Simple CRUD Generator for LaravelHugo -- gohugo.ioenCopyright &copy; 2021 Nafies Luthfi.Sat, 30 Jan 2021 21:00:00 +0800About this packagehttps://nafiesl.github.io/SimpleCrudGenerator/docs/about/Sat, 30 Jan 2021 21:00:00 +0800https://nafiesl.github.io/SimpleCrudGenerator/docs/about/About this package This package contains artisan make:crud commands to create a simple CRUD feature with test classes on our Laravel 5.5 (and later) application. This package is fairly simple, to boost test-driven development method on our laravel application. With this package installed on local environment, we can use (e.g.) php artisan make:crud Vehicle command to generate some files : App\Models\Vehicle.php eloquent model xxx_create_vehicles_table.php migration file VehicleController.php index.blade.php and forms.How to installhttps://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-install/Sat, 30 Jan 2021 21:00:00 +0800https://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-install/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.How to usehttps://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-use/Sat, 30 Jan 2021 21:00:00 +0800https://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-use/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. diff --git a/docs/license/index.html b/docs/license/index.html index 8d57201..6d117b6 100644 --- a/docs/license/index.html +++ b/docs/license/index.html @@ -78,13 +78,13 @@ items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIn items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIndex].offsetTop+items[activeIndex].clientHeight-searchContainerMaxHeight;if(overflowedPixel<0){document.querySelector(".search-content").scrollTop-=items[activeIndex].getBoundingClientRect().height;}else{document.querySelector(".search-content").scrollTop=overflowedPixel+items[activeIndex].getBoundingClientRect().height;}}else if(e.key==='Enter'){var currentItemLink=items[activeIndex].getAttribute('href');if(currentItemLink){location.href=currentItemLink;}}else if(e.key==='Escape'){e.target.value=null;if(searchResults){searchResults.classList.remove('is-active');}}}):null;searchMobile?searchMobile.addEventListener('input',function(e){if(!e.target.value){let wrap=document.getElementById('search-mobile-results');while(wrap.firstChild){wrap.removeChild(wrap.firstChild);} return null;} searchText=e.target.value;var results=fuse.search(e.target.value);if(enableSearchHighlight){renderSearchHighlightResultsMobile(searchText,results);}else{renderSearchResultsMobile(searchText,results);} -var dropdownItems=searchResultsContainer.querySelectorAll('.dd-item');dropdownItems?dropdownItems.forEach(function(item){item.addEventListener('mousedown',function(e){e.target.click();});}):null;}):null;}

License

\ No newline at end of file +switchElem.className='switch';},}).register("screen and (max-width:600px)",{match:function(){listSide.className='hide';listMain.className='lmr';singleMenu.className='hide';switchElem.className='hide';},unmatch:function(){listSide.className='hide';listMain.className='mr';singleMenu.className='l';switchElem.className='hide';},});
\ No newline at end of file diff --git a/docs/model-attributes/index.html b/docs/model-attributes/index.html index b79a805..0f3b67e 100644 --- a/docs/model-attributes/index.html +++ b/docs/model-attributes/index.html @@ -78,13 +78,13 @@ items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIn items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIndex].offsetTop+items[activeIndex].clientHeight-searchContainerMaxHeight;if(overflowedPixel<0){document.querySelector(".search-content").scrollTop-=items[activeIndex].getBoundingClientRect().height;}else{document.querySelector(".search-content").scrollTop=overflowedPixel+items[activeIndex].getBoundingClientRect().height;}}else if(e.key==='Enter'){var currentItemLink=items[activeIndex].getAttribute('href');if(currentItemLink){location.href=currentItemLink;}}else if(e.key==='Escape'){e.target.value=null;if(searchResults){searchResults.classList.remove('is-active');}}}):null;searchMobile?searchMobile.addEventListener('input',function(e){if(!e.target.value){let wrap=document.getElementById('search-mobile-results');while(wrap.firstChild){wrap.removeChild(wrap.firstChild);} return null;} searchText=e.target.value;var results=fuse.search(e.target.value);if(enableSearchHighlight){renderSearchHighlightResultsMobile(searchText,results);}else{renderSearchResultsMobile(searchText,results);} -var dropdownItems=searchResultsContainer.querySelectorAll('.dd-item');dropdownItems?dropdownItems.forEach(function(item){item.addEventListener('mousedown',function(e){e.target.click();});}):null;}):null;}

Model Attribute/Column

Model Attribute/Column

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.

What's on this Page
\ No newline at end of file +switchElem.className='switch';},}).register("screen and (max-width:600px)",{match:function(){listSide.className='hide';listMain.className='lmr';singleMenu.className='hide';switchElem.className='hide';},unmatch:function(){listSide.className='hide';listMain.className='mr';singleMenu.className='l';switchElem.className='hide';},});
\ No newline at end of file diff --git a/docs/publishing-the-stub-files/index.html b/docs/publishing-the-stub-files/index.html index d59e28a..1f2c7c1 100644 --- a/docs/publishing-the-stub-files/index.html +++ b/docs/publishing-the-stub-files/index.html @@ -78,13 +78,13 @@ items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIn items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIndex].offsetTop+items[activeIndex].clientHeight-searchContainerMaxHeight;if(overflowedPixel<0){document.querySelector(".search-content").scrollTop-=items[activeIndex].getBoundingClientRect().height;}else{document.querySelector(".search-content").scrollTop=overflowedPixel+items[activeIndex].getBoundingClientRect().height;}}else if(e.key==='Enter'){var currentItemLink=items[activeIndex].getAttribute('href');if(currentItemLink){location.href=currentItemLink;}}else if(e.key==='Escape'){e.target.value=null;if(searchResults){searchResults.classList.remove('is-active');}}}):null;searchMobile?searchMobile.addEventListener('input',function(e){if(!e.target.value){let wrap=document.getElementById('search-mobile-results');while(wrap.firstChild){wrap.removeChild(wrap.firstChild);} return null;} searchText=e.target.value;var results=fuse.search(e.target.value);if(enableSearchHighlight){renderSearchHighlightResultsMobile(searchText,results);}else{renderSearchResultsMobile(searchText,results);} -var dropdownItems=searchResultsContainer.querySelectorAll('.dd-item');dropdownItems?dropdownItems.forEach(function(item){item.addEventListener('mousedown',function(e){e.target.click();});}):null;}):null;}

Publishing the stub files

Publishing the stub files

Publishing the stub files

Stub files is the templates which we use to generate the code for each model classes and files. We can customize the stub files as we needed by publishing them to our project directory.

1
 
$ php artisan vendor:publish --provider="Luthfi\CrudGenerator\ServiceProvider" --tag=stubs
 

That will generate stub files on stubs/simple-crud directory. Now we can change some stub files based on our project needs.

What's on this Page
\ No newline at end of file +switchElem.className='switch';},}).register("screen and (max-width:600px)",{match:function(){listSide.className='hide';listMain.className='lmr';singleMenu.className='hide';switchElem.className='hide';},unmatch:function(){listSide.className='hide';listMain.className='mr';singleMenu.className='l';switchElem.className='hide';},});
\ No newline at end of file diff --git a/docs/screenshots/index.html b/docs/screenshots/index.html index a7ffb4b..f565fd5 100644 --- a/docs/screenshots/index.html +++ b/docs/screenshots/index.html @@ -78,13 +78,13 @@ items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIn items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIndex].offsetTop+items[activeIndex].clientHeight-searchContainerMaxHeight;if(overflowedPixel<0){document.querySelector(".search-content").scrollTop-=items[activeIndex].getBoundingClientRect().height;}else{document.querySelector(".search-content").scrollTop=overflowedPixel+items[activeIndex].getBoundingClientRect().height;}}else if(e.key==='Enter'){var currentItemLink=items[activeIndex].getAttribute('href');if(currentItemLink){location.href=currentItemLink;}}else if(e.key==='Escape'){e.target.value=null;if(searchResults){searchResults.classList.remove('is-active');}}}):null;searchMobile?searchMobile.addEventListener('input',function(e){if(!e.target.value){let wrap=document.getElementById('search-mobile-results');while(wrap.firstChild){wrap.removeChild(wrap.firstChild);} return null;} searchText=e.target.value;var results=fuse.search(e.target.value);if(enableSearchHighlight){renderSearchHighlightResultsMobile(searchText,results);}else{renderSearchResultsMobile(searchText,results);} -var dropdownItems=searchResultsContainer.querySelectorAll('.dd-item');dropdownItems?dropdownItems.forEach(function(item){item.addEventListener('mousedown',function(e){e.target.click();});}):null;}):null;}

Screenshots

\ No newline at end of file +switchElem.className='switch';},}).register("screen and (max-width:600px)",{match:function(){listSide.className='hide';listMain.className='lmr';singleMenu.className='hide';switchElem.className='hide';},unmatch:function(){listSide.className='hide';listMain.className='mr';singleMenu.className='l';switchElem.className='hide';},});
\ No newline at end of file diff --git a/docs/views/index.html b/docs/views/index.html index 944aa2a..b3c2559 100644 --- a/docs/views/index.html +++ b/docs/views/index.html @@ -78,13 +78,13 @@ items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIn items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIndex].offsetTop+items[activeIndex].clientHeight-searchContainerMaxHeight;if(overflowedPixel<0){document.querySelector(".search-content").scrollTop-=items[activeIndex].getBoundingClientRect().height;}else{document.querySelector(".search-content").scrollTop=overflowedPixel+items[activeIndex].getBoundingClientRect().height;}}else if(e.key==='Enter'){var currentItemLink=items[activeIndex].getAttribute('href');if(currentItemLink){location.href=currentItemLink;}}else if(e.key==='Escape'){e.target.value=null;if(searchResults){searchResults.classList.remove('is-active');}}}):null;searchMobile?searchMobile.addEventListener('input',function(e){if(!e.target.value){let wrap=document.getElementById('search-mobile-results');while(wrap.firstChild){wrap.removeChild(wrap.firstChild);} return null;} searchText=e.target.value;var results=fuse.search(e.target.value);if(enableSearchHighlight){renderSearchHighlightResultsMobile(searchText,results);}else{renderSearchResultsMobile(searchText,results);} -var dropdownItems=searchResultsContainer.querySelectorAll('.dd-item');dropdownItems?dropdownItems.forEach(function(item){item.addEventListener('mousedown',function(e){e.target.click();});}):null;}):null;}

Views

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.

\ No newline at end of file +switchElem.className='switch';},}).register("screen and (max-width:600px)",{match:function(){listSide.className='hide';listMain.className='lmr';singleMenu.className='hide';switchElem.className='hide';},unmatch:function(){listSide.className='hide';listMain.className='mr';singleMenu.className='l';switchElem.className='hide';},});
\ No newline at end of file diff --git a/index.html b/index.html index b426dea..855355a 100644 --- a/index.html +++ b/index.html @@ -78,13 +78,13 @@ items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIn items[activeIndex].classList.add('is-active');let overflowedPixel=items[activeIndex].offsetTop+items[activeIndex].clientHeight-searchContainerMaxHeight;if(overflowedPixel<0){document.querySelector(".search-content").scrollTop-=items[activeIndex].getBoundingClientRect().height;}else{document.querySelector(".search-content").scrollTop=overflowedPixel+items[activeIndex].getBoundingClientRect().height;}}else if(e.key==='Enter'){var currentItemLink=items[activeIndex].getAttribute('href');if(currentItemLink){location.href=currentItemLink;}}else if(e.key==='Escape'){e.target.value=null;if(searchResults){searchResults.classList.remove('is-active');}}}):null;searchMobile?searchMobile.addEventListener('input',function(e){if(!e.target.value){let wrap=document.getElementById('search-mobile-results');while(wrap.firstChild){wrap.removeChild(wrap.firstChild);} return null;} searchText=e.target.value;var results=fuse.search(e.target.value);if(enableSearchHighlight){renderSearchHighlightResultsMobile(searchText,results);}else{renderSearchResultsMobile(searchText,results);} -var dropdownItems=searchResultsContainer.querySelectorAll('.dd-item');dropdownItems?dropdownItems.forEach(function(item){item.addEventListener('mousedown',function(e){e.target.click();});}):null;}):null;}
Site Landing Page image
Simple CRUD Generator
A Laravel CRUD generator package, complete with automated testing suite.

About this Package

This package contains artisan make:crud commands to create a simple CRUD feature with test classes on our Laravel 5.5 (and later) application. This package is fairly simple, to boost test-driven development method on our laravel application.
Generate Model CRUD
Generate Model CRUD
Generating Create, Read, Update and Delete scaffolds for a model with policy object class and Bootstrap 4 or 3 views.
Generate Tests
Generate Tests
Generates feature test for CRUD operations, model and policy unit tests for the related CRUD feature of model.
Generate API Endpoints
Generate API Endpoints
Generates API endpoints for Create, Read, Update and Delete a model along with the feature and unit tests.
\ No newline at end of file +Go to Github

About this Package

This package contains artisan make:crud commands to create a simple CRUD feature with test classes on our Laravel 5.5 (and later) application. This package is fairly simple, to boost test-driven development method on our laravel application.
Generate Model CRUD
Generate Model CRUD
Generating Create, Read, Update and Delete scaffolds for a model with policy object class and Bootstrap 4 or 3 views.
Generate Tests
Generate Tests
Generates feature test for CRUD operations, model and policy unit tests for the related CRUD feature of model.
Generate API Endpoints
Generate API Endpoints
Generates API endpoints for Create, Read, Update and Delete a model along with the feature and unit tests.
\ No newline at end of file diff --git a/index.xml b/index.xml index c8cb770..708e660 100644 --- a/index.xml +++ b/index.xml @@ -1,4 +1,4 @@ -Laravel Simple CRUD Generator on Simple CRUD Generator for Laravelhttps://nafiesl.github.io/SimpleCrudGenerator/Recent content in Laravel Simple CRUD Generator on Simple CRUD Generator for LaravelHugo -- gohugo.ioenCopyright &copy; 2017 Nafies Luthfi.Tue, 19 Jan 2021 19:41:00 +0800About this packagehttps://nafiesl.github.io/SimpleCrudGenerator/docs/about/Sat, 30 Jan 2021 21:00:00 +0800https://nafiesl.github.io/SimpleCrudGenerator/docs/about/About this package This package contains artisan make:crud commands to create a simple CRUD feature with test classes on our Laravel 5.5 (and later) application. This package is fairly simple, to boost test-driven development method on our laravel application. +Laravel Simple CRUD Generator on Simple CRUD Generator for Laravelhttps://nafiesl.github.io/SimpleCrudGenerator/Recent content in Laravel Simple CRUD Generator on Simple CRUD Generator for LaravelHugo -- gohugo.ioenCopyright &copy; 2021 Nafies Luthfi.Tue, 19 Jan 2021 19:41:00 +0800About this packagehttps://nafiesl.github.io/SimpleCrudGenerator/docs/about/Sat, 30 Jan 2021 21:00:00 +0800https://nafiesl.github.io/SimpleCrudGenerator/docs/about/About this package This package contains artisan make:crud commands to create a simple CRUD feature with test classes on our Laravel 5.5 (and later) application. This package is fairly simple, to boost test-driven development method on our laravel application. With this package installed on local environment, we can use (e.g.) php artisan make:crud Vehicle command to generate some files : App\Models\Vehicle.php eloquent model xxx_create_vehicles_table.php migration file VehicleController.php index.blade.php and forms.How to installhttps://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-install/Sat, 30 Jan 2021 21:00:00 +0800https://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-install/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.How to usehttps://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-use/Sat, 30 Jan 2021 21:00:00 +0800https://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-use/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.