diff --git a/404.html b/404.html index d94cffa..ad7bc38 100644 --- a/404.html +++ b/404.html @@ -82,6 +82,6 @@ var dropdownItems=searchResultsContainer.querySelectorAll('.dd-item');dropdownIt menuTitle?menuTitle.forEach(function(elem){elem.onclick=function(){closeDrawer();localStorage.setItem('isDrawerOpen','false');}}):null;
Page not found
\ No newline at end of file diff --git a/docs/about/index.html b/docs/about/index.html new file mode 100644 index 0000000..363fb9f --- /dev/null +++ b/docs/about/index.html @@ -0,0 +1,104 @@ +About this package – Simple CRUD Generator for Laravel

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 diff --git a/docs/available-commands/index.html b/docs/available-commands/index.html new file mode 100644 index 0000000..5b27eef --- /dev/null +++ b/docs/available-commands/index.html @@ -0,0 +1,114 @@ +Available Commands – Simple CRUD Generator for Laravel

Available Commands

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
+
\ No newline at end of file diff --git a/docs/config-file/index.html b/docs/config-file/index.html new file mode 100644 index 0000000..e0ae5ae --- /dev/null +++ b/docs/config-file/index.html @@ -0,0 +1,130 @@ +Config File – Simple CRUD Generator for Laravel

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
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+
<?php
+
+return [
+    // The master view layout that generated views will extends
+    'default_layout_view' => 'layouts.app',
+
+    // The base test case class path for generated testing classes
+    'base_test_path' => 'tests/BrowserKitTest.php',
+
+    // The base test class full name
+    'base_test_class' => 'Tests\BrowserKitTest',
+];
+
What's on this Page
\ No newline at end of file diff --git a/docs/for-api/index.html b/docs/for-api/index.html new file mode 100644 index 0000000..62b0f88 --- /dev/null +++ b/docs/for-api/index.html @@ -0,0 +1,122 @@ +For API – Simple CRUD Generator for Laravel

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...
+$uri = 'http://your-domain.com/api/vehicles/'.$vehicleID;
+$headers = ['Authorization' => 'Bearer '.$apiToken];
+
+$client = new \GuzzleHttp\Client();
+$res = $client->request('GET', $uri, ['headers' => $headers]);
+

// Create a new Vehicle record...
+$uri = 'http://your-domain.com/api/vehicles';
+$headers = ['Authorization' => 'Bearer '.$apiToken];
+$payload = json_encode([
+    'title' => 'Vehicle Name 1',
+    'description' => 'Vehicle Description 1',
+]);
+
+$client = new \GuzzleHttp\Client();
+$res = $client->request('POST', $uri, ['body' => $payload, 'headers' => $headers]);
+

The generated functional tests will give you examples of how to adapt this code for other call types.

What's on this Page
\ No newline at end of file diff --git a/docs/generated-testing-suite/index.html b/docs/generated-testing-suite/index.html new file mode 100644 index 0000000..4e42f67 --- /dev/null +++ b/docs/generated-testing-suite/index.html @@ -0,0 +1,122 @@ +Generated Testing Suite – Simple CRUD Generator for Laravel

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
+4
+5
+6
+7
+8
+
<phpunit>
+    <!-- ..... -->
+    <php>
+        <!-- ..... -->
+        <server name="DB_CONNECTION" value="sqlite"/>
+        <server name="DB_DATABASE" value=":memory:"/>
+    </php>
+</phpunit>
+

Then run PHPUnit

1
+
$ vendor/bin/phpunit
+

All tests should be passed.

Generated Testing Suite on Simple CRUD Generator

What's on this Page
\ No newline at end of file diff --git a/docs/how-to-install/index.html b/docs/how-to-install/index.html new file mode 100644 index 0000000..eadd7ff --- /dev/null +++ b/docs/how-to-install/index.html @@ -0,0 +1,122 @@ +How to install – Simple CRUD Generator for Laravel

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.0
+
+# Get the package
+$ composer require luthfi/simple-crud-generator 1.2.* --dev
+
\ No newline at end of file diff --git a/docs/how-to-use/index.html b/docs/how-to-use/index.html new file mode 100644 index 0000000..fe708e6 --- /dev/null +++ b/docs/how-to-use/index.html @@ -0,0 +1,190 @@ +How to use – Simple CRUD Generator for Laravel

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
+ 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.
+VehicleController generated.
+Vehicle index view file generated.
+Vehicle form view file generated.
+lang/app.php generated.
+vehicle lang files generated.
+Vehicle model factory generated.
+Vehicle model policy generated.
+AuthServiceProvider class has been updated.
+BrowserKitTest generated.
+ManageVehiclesTest generated.
+VehicleTest (model) generated.
+VehiclePolicyTest (model policy) generated.
+CRUD files generated successfully!
+

Make sure we have set database credential on .env file, then :

1
+2
+
$ php artisan migrate
+$ php artisan serve
+

Then visit our application url: http://localhost:8000/vehicles.


Usage on Fresh Install Laravel 8.x

In this example, we are using the laravel installer package to install new laravel project.

 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
# This is example commands for Ubuntu users.
+$ laravel new project-directory
+$ cd project-directory
+$ composer require laravel/ui
+$ php artisan ui bootstrap --auth
+$ npm install && npm run dev # Might need to run twice, minimum requirement: NodeJS v12.x
+$ vim .env # Edit your .env file to update database configuration
+
+# Install the package
+$ composer require luthfi/simple-crud-generator:^2.0
+
+# I really suggest "git commit" your project right before you run the make:crud command
+$ php artisan make:crud Vehicle # Model name in singular
+
+$ php artisan migrate
+$ php artisan serve
+# Visit your route http://127.0.0.1:8000
+# Register as a new user
+# Visit your route http://127.0.0.1:8000/vehicles
+
+# Run the unit tests
+$ vim phpunit.xml # Remove comments on the DB_CONNECTION and DB_DATABASE lines
+$ vendor/bin/phpunit
+
\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 4cf2fe9..d3b6bda 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,4 +1,4 @@ -Docs – Simple CRUD Generator for Laravel

Simple CRUD Generator

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.

License

\ No newline at end of file diff --git a/docs/model-attributes/index.html b/docs/model-attributes/index.html new file mode 100644 index 0000000..b79a805 --- /dev/null +++ b/docs/model-attributes/index.html @@ -0,0 +1,104 @@ +Model Attribute/Column – Simple CRUD Generator for Laravel

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 diff --git a/docs/publishing-the-stub-files/index.html b/docs/publishing-the-stub-files/index.html new file mode 100644 index 0000000..d59e28a --- /dev/null +++ b/docs/publishing-the-stub-files/index.html @@ -0,0 +1,106 @@ +Publishing the stub files – Simple CRUD Generator for Laravel

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 diff --git a/docs/screenshots/index.html b/docs/screenshots/index.html new file mode 100644 index 0000000..a7ffb4b --- /dev/null +++ b/docs/screenshots/index.html @@ -0,0 +1,104 @@ +Screenshots – Simple CRUD Generator for Laravel

Screenshots

\ No newline at end of file diff --git a/docs/views/index.html b/docs/views/index.html new file mode 100644 index 0000000..944aa2a --- /dev/null +++ b/docs/views/index.html @@ -0,0 +1,104 @@ +Views – Simple CRUD Generator for Laravel

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 diff --git a/images/simple-crud-generator-01.jpg b/images/simple-crud-generator-01.jpg new file mode 100644 index 0000000..f609c31 Binary files /dev/null and b/images/simple-crud-generator-01.jpg differ diff --git a/images/simple-crud-generator-02.jpg b/images/simple-crud-generator-02.jpg new file mode 100644 index 0000000..728addd Binary files /dev/null and b/images/simple-crud-generator-02.jpg differ diff --git a/index.html b/index.html index 0144bb2..b426dea 100644 --- a/index.html +++ b/index.html @@ -82,7 +82,7 @@ var dropdownItems=searchResultsContainer.querySelectorAll('.dd-item');dropdownIt menuTitle?menuTitle.forEach(function(elem){elem.onclick=function(){closeDrawer();localStorage.setItem('isDrawerOpen','false');}}):null;
Site Landing Page image
Simple CRUD Generator
A Laravel CRUD generator package, complete with automated testing suite.
diff --git a/index.json b/index.json index 1fa8c00..c2bcfe0 100644 --- a/index.json +++ b/index.json @@ -1 +1 @@ -[{"content":"Markdown here\n","description":"test post","id":0,"section":"updates","tags":null,"title":"May 2019","uri":"https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_may/"},{"content":"Markdown here\n","description":"test post","id":1,"section":"docs","tags":null,"title":"Basic Usage","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/gettingstarted/basicusage/"},{"content":"Markdown here\n","description":"test post","id":2,"section":"updates","tags":null,"title":"April 2019","uri":"https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_april/"},{"content":"Markdown here\n","description":"test post","id":3,"section":"docs","tags":null,"title":"Configuration","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/gettingstarted/configuration/"},{"content":"Markdown here\n","description":"test post","id":4,"section":"updates","tags":null,"title":"March 2019","uri":"https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_march/"},{"content":"Markdown here\n","description":"test post","id":5,"section":"docs","tags":null,"title":"Installation","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/gettingstarted/installation/"},{"content":"Markdown here\n","description":"test post","id":6,"section":"updates","tags":null,"title":"February 2019","uri":"https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_february/"},{"content":"Markdown here\n","description":"test post","id":7,"section":"docs","tags":null,"title":"Quick Start","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/gettingstarted/quickstart/"},{"content":"Markdown here\n","description":"test post","id":8,"section":"updates","tags":null,"title":"January 2019","uri":"https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_january/"},{"content":"Markdown here\n","description":"test post","id":13,"section":"docs","tags":null,"title":"Related content","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/relatedcontent/"},{"content":"Markdown here\n","description":"test post","id":14,"section":"docs","tags":null,"title":"Page Resources","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/pageresources/"},{"content":"Markdown here\n","description":"test post","id":15,"section":"docs","tags":null,"title":"Page Bundles","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/pagebundles/"},{"content":"Markdown here\n","description":"test post","id":16,"section":"docs","tags":null,"title":"Content Formats","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/contentfortmats/"},{"content":"Markdown here\n","description":"test post","id":17,"section":"docs","tags":null,"title":"Image Processing","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/imageprocessing/"},{"content":"Markdown here\n","description":"test post","id":18,"section":"docs","tags":null,"title":"Shortcodes","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/contentmanagement/shortcodes/"},{"content":"Markdown here\n","description":"test post","id":19,"section":"docs","tags":null,"title":"Frontmatter","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/contentmanagement/frontmatter/"},{"content":"Lorem est tota propiore conpellat pectoribus de\npectora summo. Redit teque digerit hominumque toris verebor lumina non cervice\nsubde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc\ncaluere tempus\nThis article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme.\n Headings The following HTML \u0026lt;h1\u0026gt;—\u0026lt;h6\u0026gt; elements represent six levels of section headings. \u0026lt;h1\u0026gt; is the highest section level while \u0026lt;h6\u0026gt; is the lowest.\nH1 H2 H3 H4 H5 H6 Paragraph Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat.\nItatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.\nBlockquotes The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a footer or cite element, and optionally with in-line changes such as annotations and abbreviations.\nBlockquote without attribution Tiam, ad mint andaepu dandae nostion secatur sequo quae.\nNote that you can use Markdown syntax within a blockquote.\n Blockquote with attribution Don\u0026rsquo;t communicate by sharing memory, share memory by communicating.\n— Rob Pike1\n Tables Tables aren\u0026rsquo;t part of the core Markdown spec, but Hugo supports supports them out-of-the-box.\n Name Age Bob 27 Alice 23 Inline Markdown within tables Inline  Markdown  In  Table italics bold strikethrough  code Code Blocks Code block with backticks html \u0026lt;!DOCTYPE html\u0026gt; \u0026lt;html lang=\u0026quot;en\u0026quot;\u0026gt; \u0026lt;head\u0026gt; \u0026lt;meta charset=\u0026quot;UTF-8\u0026quot;\u0026gt; \u0026lt;title\u0026gt;Example HTML5 Document\u0026lt;/title\u0026gt; \u0026lt;/head\u0026gt; \u0026lt;body\u0026gt; \u0026lt;p\u0026gt;Test\u0026lt;/p\u0026gt; \u0026lt;/body\u0026gt; \u0026lt;/html\u0026gt; Code block indented with four spaces \u0026lt;!DOCTYPE html\u0026gt; \u0026lt;html lang=\u0026quot;en\u0026quot;\u0026gt; \u0026lt;head\u0026gt; \u0026lt;meta charset=\u0026quot;UTF-8\u0026quot;\u0026gt; \u0026lt;title\u0026gt;Example HTML5 Document\u0026lt;/title\u0026gt; \u0026lt;/head\u0026gt; \u0026lt;body\u0026gt; \u0026lt;p\u0026gt;Test\u0026lt;/p\u0026gt; \u0026lt;/body\u0026gt; \u0026lt;/html\u0026gt; Code block with Hugo\u0026rsquo;s internal highlight shortcode 1 2 3 4 5 6 7 8 9 10 \u0026lt;!DOCTYPE html\u0026gt; \u0026lt;html lang=\u0026#34;en\u0026#34;\u0026gt; \u0026lt;head\u0026gt; \u0026lt;meta charset=\u0026#34;UTF-8\u0026#34;\u0026gt; \u0026lt;title\u0026gt;Example HTML5 Document\u0026lt;/title\u0026gt; \u0026lt;/head\u0026gt; \u0026lt;body\u0026gt; \u0026lt;p\u0026gt;Test\u0026lt;/p\u0026gt; \u0026lt;/body\u0026gt; \u0026lt;/html\u0026gt; List Types Ordered List First item Second item Third item Unordered List List item Another item And another item Nested list Item First Sub-item Second Sub-item Other Elements — abbr, sub, sup, kbd, mark GIF is a bitmap image format.\nH2O\nXn + Yn = Zn\nPress CTRL+ALT+Delete to end the session.\nMost salamanders are nocturnal, and hunt for insects, worms, and other small creatures.\n The above quote is excerpted from Rob Pike\u0026rsquo;s talk during Gopherfest, November 18, 2015. \u0026#x21a9;\u0026#xfe0e;\n ","description":"","id":20,"section":"blog","tags":["markdown","css","html","themes"],"title":"Markdown Syntax Guide","uri":"https://nafiesl.github.io/SimpleCrudGenerator/blog/markdown-syntax/"},{"content":"This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme.\nHeadings The following HTML \u0026lt;h1\u0026gt;—\u0026lt;h6\u0026gt; elements represent six levels of section headings. \u0026lt;h1\u0026gt; is the highest section level while \u0026lt;h6\u0026gt; is the lowest.\nH1 H2 H3 H4 H5 H6 Paragraph Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat.\nItatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.\nBlockquotes The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a footer or cite element, and optionally with in-line changes such as annotations and abbreviations.\nBlockquote without attribution Tiam, ad mint andaepu dandae nostion secatur sequo quae.\nNote that you can use Markdown syntax within a blockquote.\n Blockquote with attribution Don\u0026rsquo;t communicate by sharing memory, share memory by communicating.\n— Rob Pike1\n Tables Tables aren\u0026rsquo;t part of the core Markdown spec, but Hugo supports supports them out-of-the-box.\n Name Age Bob 27 Alice 23 Inline Markdown within tables Inline  Markdown  In  Table italics bold strikethrough  code Code Blocks Code block with backticks html \u0026lt;!DOCTYPE html\u0026gt; \u0026lt;html lang=\u0026quot;en\u0026quot;\u0026gt; \u0026lt;head\u0026gt; \u0026lt;meta charset=\u0026quot;UTF-8\u0026quot;\u0026gt; \u0026lt;title\u0026gt;Example HTML5 Document\u0026lt;/title\u0026gt; \u0026lt;/head\u0026gt; \u0026lt;body\u0026gt; \u0026lt;p\u0026gt;Test\u0026lt;/p\u0026gt; \u0026lt;/body\u0026gt; \u0026lt;/html\u0026gt; Code block indented with four spaces \u0026lt;!DOCTYPE html\u0026gt; \u0026lt;html lang=\u0026quot;en\u0026quot;\u0026gt; \u0026lt;head\u0026gt; \u0026lt;meta charset=\u0026quot;UTF-8\u0026quot;\u0026gt; \u0026lt;title\u0026gt;Example HTML5 Document\u0026lt;/title\u0026gt; \u0026lt;/head\u0026gt; \u0026lt;body\u0026gt; \u0026lt;p\u0026gt;Test\u0026lt;/p\u0026gt; \u0026lt;/body\u0026gt; \u0026lt;/html\u0026gt; Code block with Hugo\u0026rsquo;s internal highlight shortcode 1 2 3 4 5 6 7 8 9 10 \u0026lt;!DOCTYPE html\u0026gt; \u0026lt;html lang=\u0026#34;en\u0026#34;\u0026gt; \u0026lt;head\u0026gt; \u0026lt;meta charset=\u0026#34;UTF-8\u0026#34;\u0026gt; \u0026lt;title\u0026gt;Example HTML5 Document\u0026lt;/title\u0026gt; \u0026lt;/head\u0026gt; \u0026lt;body\u0026gt; \u0026lt;p\u0026gt;Test\u0026lt;/p\u0026gt; \u0026lt;/body\u0026gt; \u0026lt;/html\u0026gt; List Types Ordered List First item Second item Third item Unordered List List item Another item And another item Nested list Item First Sub-item Second Sub-item Other Elements — abbr, sub, sup, kbd, mark GIF is a bitmap image format.\nH2O\nXn + Yn = Zn\nPress CTRL+ALT+Delete to end the session.\nMost salamanders are nocturnal, and hunt for insects, worms, and other small creatures.\n The above quote is excerpted from Rob Pike\u0026rsquo;s talk during Gopherfest, November 18, 2015. \u0026#x21a9;\u0026#xfe0e;\n ","description":"Sample article showcasing basic Markdown syntax and formatting for HTML elements.","id":21,"section":"docs","tags":["markdown","css","html","themes"],"title":"Section","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/contentmanagement/sections/"},{"content":"Lorem est tota propiore conpellat pectoribus de\npectora summo. Redit teque digerit hominumque toris verebor lumina non cervice\nsubde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc\ncaluere tempus\nHugo ships with several Built-in Shortcodes for rich content, along with a Privacy Config and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds.\n YouTube Privacy Enhanced Shortcode Twitter Simple Shortcode .twitter-tweet { font: 14px/1.45 -apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif; border-left: 4px solid #2b7bb9; padding-left: 1.5em; color: #555; } .twitter-tweet a { color: #2b7bb9; text-decoration: none; } blockquote.twitter-tweet a:hover, blockquote.twitter-tweet a:focus { text-decoration: underline; } “In addition to being more logical, asymmetry has the advantage that its complete appearance is far more optically effective than symmetry.”\n— Jan Tschichold pic.twitter.com/gcv7SrhvJb\n\u0026mdash; Graphic Design History (@DesignReviewed) January 17, 2019 Vimeo Simple Shortcode .__h_video { position: relative; padding-bottom: 56.23%; height: 0; overflow: hidden; width: 100%; background: #000; } .__h_video img { width: 100%; height: auto; color: #000; } .__h_video .play { height: 72px; width: 72px; left: 50%; top: 50%; margin-left: -36px; margin-top: -36px; position: absolute; cursor: pointer; } ","description":"","id":22,"section":"blog","tags":["shortcodes","privacy"],"title":"Rich Content","uri":"https://nafiesl.github.io/SimpleCrudGenerator/blog/rich-content/"},{"content":"Lorem est tota propiore conpellat pectoribus de\npectora summo. Redit teque digerit hominumque toris verebor lumina non cervice\nsubde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc\ncaluere tempus\ninhospita parcite confusaque translucet patri vestro qui optatis\nlumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum.\n Exierant elisi ambit vivere dedere Duce pollice Eris modo Spargitque ferrea quos palude Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus\nsilentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria\ntractus malis.\n Comas hunc haec pietate fetum procerum dixit Post torum vates letum Tiresia Flumen querellas Arcanaque montibus omnes Quidem et Vagus elidunt \nThe Van de Graaf Canon\nMane refeci capiebant unda mulcebat Victa caducifer, malo vulnere contra\ndicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere\nfurit nec; iaculi matertera et visa est, viribus. Divesque creatis, tecta novat collumque vulnus est, parvas. Faces illo pepulere tempus adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis.\nIubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli\nLelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare\nEchionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert\nausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae\nvulnus haerentia iuste et exercebat, sui et.\nEurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel mitis temploque vocatus, inque alis, oculos nomen non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem\nPropoetides parte.\n","description":"","id":23,"section":"blog","tags":["markdown","text"],"title":"Placeholder Text","uri":"https://nafiesl.github.io/SimpleCrudGenerator/blog/placeholder-text/"},{"content":"Lorem est tota propiore conpellat pectoribus de\npectora summo. Redit teque digerit hominumque toris verebor lumina non cervice\nsubde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc\ncaluere tempus\nEmoji can be enabled in a Hugo project in a number of ways.\n The emojify function can be called directly in templates or Inline Shortcodes.\nTo enable emoji globally, set enableEmoji to true in your site’s configuration and then you can type emoji shorthand codes directly in content files; e.g.\n🙈 🙈 🙉 🙉 🙊 🙊\nThe Emoji cheat sheet is a useful reference for emoji shorthand codes.\nN.B. The above steps enable Unicode Standard emoji characters and sequences in Hugo, however the rendering of these glyphs depends on the browser and the platform. To style the emoji you can either use a third party emoji font or a font stack; e.g.\n1 2 3 .emoji { font-family: Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols; } ","description":"","id":24,"section":"blog","tags":["emoji"],"title":"Emoji Support","uri":"https://nafiesl.github.io/SimpleCrudGenerator/blog/emoji-support/"}] \ No newline at end of file +[{"content":"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.\nWith this package installed on local environment, we can use (e.g.) php artisan make:crud Vehicle command to generate some files :\n 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 :\n 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 :\n 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.\n","description":"This package contains artisan make:crud commands to create a simple CRUD feature with test classes on our Laravel application.","id":0,"section":"docs","tags":null,"title":"About this package","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/about/"},{"content":"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 :\n1 2 3 4 5 # Install required package for laravel/browser-kit-testing $ composer require symfony/css-selector:^3.0 # Get the package $ composer require luthfi/simple-crud-generator 1.2.* --dev ","description":"Install the package with composer.","id":1,"section":"docs","tags":null,"title":"How to install","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-install/"},{"content":"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.\nFor example we want to create CRUD for \u0026lsquo;App\\Models\\Vehicle\u0026rsquo; model.\n1 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. VehicleController generated. Vehicle index view file generated. Vehicle form view file generated. lang/app.php generated. vehicle lang files generated. Vehicle model factory generated. Vehicle model policy generated. AuthServiceProvider class has been updated. BrowserKitTest generated. ManageVehiclesTest generated. VehicleTest (model) generated. VehiclePolicyTest (model policy) generated. CRUD files generated successfully! Make sure we have set database credential on .env file, then :\n1 2 $ php artisan migrate $ php artisan serve Then visit our application url: http://localhost:8000/vehicles.\nUsage on Fresh Install Laravel 8.x In this example, we are using the laravel installer package to install new laravel project.\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 # This is example commands for Ubuntu users. $ laravel new project-directory $ cd project-directory $ composer require laravel/ui $ php artisan ui bootstrap --auth $ npm install \u0026amp;\u0026amp; npm run dev # Might need to run twice, minimum requirement: NodeJS v12.x $ vim .env # Edit your .env file to update database configuration # Install the package $ composer require luthfi/simple-crud-generator:^2.0 # I really suggest \u0026#34;git commit\u0026#34; your project right before you run the make:crud command $ php artisan make:crud Vehicle # Model name in singular $ php artisan migrate $ php artisan serve # Visit your route http://127.0.0.1:8000 # Register as a new user # Visit your route http://127.0.0.1:8000/vehicles # Run the unit tests $ vim phpunit.xml # Remove comments on the DB_CONNECTION and DB_DATABASE lines $ vendor/bin/phpunit ","description":"How ot use the package.","id":2,"section":"docs","tags":null,"title":"How to use","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-use/"},{"content":"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":"Available commands and options.","id":3,"section":"docs","tags":null,"title":"Available Commands","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/available-commands/"},{"content":"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.\n","description":"Model attributes or column generated by the package.","id":4,"section":"docs","tags":null,"title":"Model Attribute/Column","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/model-attributes/"},{"content":"Views Bootstrap 4 Views The generated view files use Bootstrap 4 by default (for Laravel 5.6 and later).\nBootstrap 3 Views We can also generates views that use Bootstrap 3 with --bs3 command option, eg for Laravel version 5.5.\nThe 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.\n","description":"The generated views are using bootstrap frontend framework.","id":5,"section":"docs","tags":null,"title":"Views","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/views/"},{"content":"For API If we want to generate API Controller with feature tests, we use following command :\n1 $ php artisan make:crud-api Vehicle By default, we use Laravel Token Based Authentication, so we need to update our user model.\n Add api_token column on our users_table_migration. Add api_token as fillable property on User model. 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.\nExample code for calling the generated API, using Guzzle:\n// Read data a specific Vehicle record... $uri = 'http://your-domain.com/api/vehicles/'.$vehicleID; $headers = ['Authorization' =\u0026gt; 'Bearer '.$apiToken]; $client = new \\GuzzleHttp\\Client(); $res = $client-\u0026gt;request('GET', $uri, ['headers' =\u0026gt; $headers]); // Create a new Vehicle record... $uri = 'http://your-domain.com/api/vehicles'; $headers = ['Authorization' =\u0026gt; 'Bearer '.$apiToken]; $payload = json_encode([ 'title' =\u0026gt; 'Vehicle Name 1', 'description' =\u0026gt; 'Vehicle Description 1', ]); $client = new \\GuzzleHttp\\Client(); $res = $client-\u0026gt;request('POST', $uri, ['body' =\u0026gt; $payload, 'headers' =\u0026gt; $headers]); The generated functional tests will give you examples of how to adapt this code for other call types.\n","description":"Generates API endpoints for model CRUD.","id":6,"section":"docs","tags":null,"title":"For API","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/for-api/"},{"content":"Config File You can configure your own by publishing the config file:\n1 $ php artisan vendor:publish --provider=\u0026#34;Luthfi\\CrudGenerator\\ServiceProvider\u0026#34; --tag=config That will generate config/simple-crud.php file.\nBy default, this package have some configuration:\n1 2 3 4 5 6 7 8 9 10 11 12 \u0026lt;?php return [ // The master view layout that generated views will extends \u0026#39;default_layout_view\u0026#39; =\u0026gt; \u0026#39;layouts.app\u0026#39;, // The base test case class path for generated testing classes \u0026#39;base_test_path\u0026#39; =\u0026gt; \u0026#39;tests/BrowserKitTest.php\u0026#39;, // The base test class full name \u0026#39;base_test_class\u0026#39; =\u0026gt; \u0026#39;Tests\\BrowserKitTest\u0026#39;, ]; ","description":"Configure the package with config file.","id":7,"section":"docs","tags":null,"title":"Config File","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/config-file/"},{"content":"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.\n1 $ php artisan vendor:publish --provider=\u0026#34;Luthfi\\CrudGenerator\\ServiceProvider\u0026#34; --tag=stubs That will generate stub files on stubs/simple-crud directory. Now we can change some stub files based on our project needs.\n","description":"Use your own stub files.","id":8,"section":"docs","tags":null,"title":"Publishing the stub files","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/publishing-the-stub-files/"},{"content":"Screenshots Visit your application in new resource route : http://127.0.0.1:8000/vehicles\n","description":"Some screenshots of the generated CRUD feature.","id":9,"section":"docs","tags":null,"title":"Screenshots","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/screenshots/"},{"content":"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 :\n1 2 3 4 5 6 7 8 \u0026lt;phpunit\u0026gt; \u0026lt;!-- ..... --\u0026gt; \u0026lt;php\u0026gt; \u0026lt;!-- ..... --\u0026gt; \u0026lt;server name=\u0026#34;DB_CONNECTION\u0026#34; value=\u0026#34;sqlite\u0026#34;/\u0026gt; \u0026lt;server name=\u0026#34;DB_DATABASE\u0026#34; value=\u0026#34;:memory:\u0026#34;/\u0026gt; \u0026lt;/php\u0026gt; \u0026lt;/phpunit\u0026gt; Then run PHPUnit\n1 $ vendor/bin/phpunit All tests should be passed.\n","description":"Some screenshots of the generated CRUD feature.","id":10,"section":"docs","tags":null,"title":"Generated Testing Suite","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/generated-testing-suite/"},{"content":"License This package is open-sourced software licensed under the MIT license.\n","description":"Some screenshots of the generated CRUD feature.","id":11,"section":"docs","tags":null,"title":"License","uri":"https://nafiesl.github.io/SimpleCrudGenerator/docs/license/"}] \ No newline at end of file diff --git a/index.xml b/index.xml index da90fe8..c8cb770 100644 --- a/index.xml +++ b/index.xml @@ -1,13 +1,16 @@ -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 +0800May 2019https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_may/Tue, 28 Jan 2020 00:10:51 +0900https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_may/Markdown hereBasic Usagehttps://nafiesl.github.io/SimpleCrudGenerator/docs/gettingstarted/basicusage/Tue, 28 Jan 2020 00:34:51 +0900https://nafiesl.github.io/SimpleCrudGenerator/docs/gettingstarted/basicusage/Markdown hereApril 2019https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_april/Tue, 28 Jan 2020 00:10:48 +0900https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_april/Markdown hereConfigurationhttps://nafiesl.github.io/SimpleCrudGenerator/docs/gettingstarted/configuration/Tue, 28 Jan 2020 00:34:56 +0900https://nafiesl.github.io/SimpleCrudGenerator/docs/gettingstarted/configuration/Markdown hereMarch 2019https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_march/Tue, 28 Jan 2020 00:10:42 +0900https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_march/Markdown hereInstallationhttps://nafiesl.github.io/SimpleCrudGenerator/docs/gettingstarted/installation/Tue, 28 Jan 2020 00:34:13 +0900https://nafiesl.github.io/SimpleCrudGenerator/docs/gettingstarted/installation/Markdown hereFebruary 2019https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_february/Tue, 28 Jan 2020 00:10:37 +0900https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_february/Markdown hereQuick Starthttps://nafiesl.github.io/SimpleCrudGenerator/docs/gettingstarted/quickstart/Tue, 28 Jan 2020 00:34:41 +0900https://nafiesl.github.io/SimpleCrudGenerator/docs/gettingstarted/quickstart/Markdown hereJanuary 2019https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_january/Tue, 28 Jan 2020 00:10:09 +0900https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_january/Markdown hereTest 1https://nafiesl.github.io/SimpleCrudGenerator/docs/depth1/test1/Thu, 30 Jan 2020 00:38:25 +0900https://nafiesl.github.io/SimpleCrudGenerator/docs/depth1/test1/Test 2https://nafiesl.github.io/SimpleCrudGenerator/docs/depth1/depth2/test2/Thu, 30 Jan 2020 00:38:25 +0900https://nafiesl.github.io/SimpleCrudGenerator/docs/depth1/depth2/test2/Test 3https://nafiesl.github.io/SimpleCrudGenerator/docs/depth1/depth2/depth3/test3/Thu, 30 Jan 2020 00:38:25 +0900https://nafiesl.github.io/SimpleCrudGenerator/docs/depth1/depth2/depth3/test3/ttttesthttps://nafiesl.github.io/SimpleCrudGenerator/docs/depth1/ttttest/Thu, 30 Jan 2020 00:38:25 +0900https://nafiesl.github.io/SimpleCrudGenerator/docs/depth1/ttttest/Related contenthttps://nafiesl.github.io/SimpleCrudGenerator/docs/relatedcontent/Tue, 28 Jan 2020 00:39:09 +0900https://nafiesl.github.io/SimpleCrudGenerator/docs/relatedcontent/Markdown herePage Resourceshttps://nafiesl.github.io/SimpleCrudGenerator/docs/pageresources/Tue, 28 Jan 2020 00:39:06 +0900https://nafiesl.github.io/SimpleCrudGenerator/docs/pageresources/Markdown herePage Bundleshttps://nafiesl.github.io/SimpleCrudGenerator/docs/pagebundles/Tue, 28 Jan 2020 00:38:59 +0900https://nafiesl.github.io/SimpleCrudGenerator/docs/pagebundles/Markdown hereContent Formatshttps://nafiesl.github.io/SimpleCrudGenerator/docs/contentfortmats/Tue, 28 Jan 2020 00:38:51 +0900https://nafiesl.github.io/SimpleCrudGenerator/docs/contentfortmats/Markdown hereImage Processinghttps://nafiesl.github.io/SimpleCrudGenerator/docs/imageprocessing/Tue, 28 Jan 2020 00:38:48 +0900https://nafiesl.github.io/SimpleCrudGenerator/docs/imageprocessing/Markdown hereShortcodeshttps://nafiesl.github.io/SimpleCrudGenerator/docs/contentmanagement/shortcodes/Tue, 28 Jan 2020 00:36:19 +0900https://nafiesl.github.io/SimpleCrudGenerator/docs/contentmanagement/shortcodes/Markdown hereFrontmatterhttps://nafiesl.github.io/SimpleCrudGenerator/docs/contentmanagement/frontmatter/Tue, 28 Jan 2020 00:36:14 +0900https://nafiesl.github.io/SimpleCrudGenerator/docs/contentmanagement/frontmatter/Markdown hereMarkdown Syntax Guidehttps://nafiesl.github.io/SimpleCrudGenerator/blog/markdown-syntax/Mon, 11 Mar 2019 00:00:00 +0000https://nafiesl.github.io/SimpleCrudGenerator/blog/markdown-syntax/<p>Lorem est tota propiore conpellat pectoribus de<br /> -pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice<br /> -subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc<br /> -caluere tempus</p>Sectionhttps://nafiesl.github.io/SimpleCrudGenerator/docs/contentmanagement/sections/Mon, 11 Mar 2019 00:00:00 +0000https://nafiesl.github.io/SimpleCrudGenerator/docs/contentmanagement/sections/<p>This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme.</p>Rich Contenthttps://nafiesl.github.io/SimpleCrudGenerator/blog/rich-content/Sun, 10 Mar 2019 00:00:00 +0000https://nafiesl.github.io/SimpleCrudGenerator/blog/rich-content/<p>Lorem est tota propiore conpellat pectoribus de<br /> -pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice<br /> -subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc<br /> -caluere tempus</p>Placeholder Texthttps://nafiesl.github.io/SimpleCrudGenerator/blog/placeholder-text/Sat, 09 Mar 2019 00:00:00 +0000https://nafiesl.github.io/SimpleCrudGenerator/blog/placeholder-text/<p>Lorem est tota propiore conpellat pectoribus de<br /> -pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice<br /> -subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc<br /> -caluere tempus</p>Emoji Supporthttps://nafiesl.github.io/SimpleCrudGenerator/blog/emoji-support/Tue, 05 Mar 2019 00:00:00 +0000https://nafiesl.github.io/SimpleCrudGenerator/blog/emoji-support/<p>Lorem est tota propiore conpellat pectoribus de<br /> -pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice<br /> -subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc<br /> -caluere tempus</p> \ No newline at end of file +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. +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. +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.Available Commandshttps://nafiesl.github.io/SimpleCrudGenerator/docs/available-commands/Sat, 30 Jan 2021 21:00:00 +0800https://nafiesl.github.io/SimpleCrudGenerator/docs/available-commands/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 ModelNameModel Attribute/Columnhttps://nafiesl.github.io/SimpleCrudGenerator/docs/model-attributes/Sat, 30 Jan 2021 21:00:00 +0800https://nafiesl.github.io/SimpleCrudGenerator/docs/model-attributes/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.Viewshttps://nafiesl.github.io/SimpleCrudGenerator/docs/views/Sat, 30 Jan 2021 21:00:00 +0800https://nafiesl.github.io/SimpleCrudGenerator/docs/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.For APIhttps://nafiesl.github.io/SimpleCrudGenerator/docs/for-api/Sat, 30 Jan 2021 21:00:00 +0800https://nafiesl.github.io/SimpleCrudGenerator/docs/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. +Add api_token column on our users_table_migration. Add api_token as fillable property on User model. 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.Config Filehttps://nafiesl.github.io/SimpleCrudGenerator/docs/config-file/Sat, 30 Jan 2021 21:00:00 +0800https://nafiesl.github.io/SimpleCrudGenerator/docs/config-file/Config File You can configure your own by publishing the config file: +1 $ php artisan vendor:publish --provider=&#34;Luthfi\CrudGenerator\ServiceProvider&#34; --tag=config That will generate config/simple-crud.php file. +By default, this package have some configuration: +1 2 3 4 5 6 7 8 9 10 11 12 &lt;?php return [ // The master view layout that generated views will extends &#39;default_layout_view&#39; =&gt; &#39;layouts.app&#39;, // The base test case class path for generated testing classes &#39;base_test_path&#39; =&gt; &#39;tests/BrowserKitTest.Publishing the stub fileshttps://nafiesl.github.io/SimpleCrudGenerator/docs/publishing-the-stub-files/Sat, 30 Jan 2021 21:00:00 +0800https://nafiesl.github.io/SimpleCrudGenerator/docs/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=&#34;Luthfi\CrudGenerator\ServiceProvider&#34; --tag=stubs That will generate stub files on stubs/simple-crud directory. Now we can change some stub files based on our project needs.Screenshotshttps://nafiesl.github.io/SimpleCrudGenerator/docs/screenshots/Sat, 30 Jan 2021 21:00:00 +0800https://nafiesl.github.io/SimpleCrudGenerator/docs/screenshots/Screenshots Visit your application in new resource route : http://127.0.0.1:8000/vehiclesGenerated Testing Suitehttps://nafiesl.github.io/SimpleCrudGenerator/docs/generated-testing-suite/Sat, 30 Jan 2021 21:00:00 +0800https://nafiesl.github.io/SimpleCrudGenerator/docs/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 4 5 6 7 8 &lt;phpunit&gt; &lt;!-- ..... --&gt; &lt;php&gt; &lt;!-- ..... --&gt; &lt;server name=&#34;DB_CONNECTION&#34; value=&#34;sqlite&#34;/&gt; &lt;server name=&#34;DB_DATABASE&#34; value=&#34;:memory:&#34;/&gt; &lt;/php&gt; &lt;/phpunit&gt; Then run PHPUnit +1 $ vendor/bin/phpunit All tests should be passed.Licensehttps://nafiesl.github.io/SimpleCrudGenerator/docs/license/Sat, 30 Jan 2021 21:00:00 +0800https://nafiesl.github.io/SimpleCrudGenerator/docs/license/License This package is open-sourced software licensed under the MIT license. \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index 6698992..59a1126 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1 +1 @@ -https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_may/2020-01-28T00:10:51+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/gettingstarted/basicusage/2020-01-28T00:34:51+09:00https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_april/2020-01-28T00:10:48+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/gettingstarted/configuration/2020-01-28T00:34:56+09:00https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_march/2020-01-28T00:10:42+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/gettingstarted/installation/2020-01-28T00:34:13+09:00https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_february/2020-01-28T00:10:37+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/gettingstarted/quickstart/2020-01-28T00:34:41+09:00https://nafiesl.github.io/SimpleCrudGenerator/updates/2019_january/2020-01-28T00:10:09+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/depth1/2020-02-28T10:08:56+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/depth1/depth2/2020-02-28T10:08:56+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/depth1/depth2/depth3/2020-02-28T10:08:56+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/depth1/test1/2020-01-30T00:38:25+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/depth1/depth2/test2/2020-01-30T00:38:25+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/depth1/depth2/depth3/test3/2020-01-30T00:38:25+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/gettingstarted/2020-01-28T00:34:39+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/depth1/ttttest/2020-01-30T00:38:25+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/contentmanagement/2020-01-28T00:36:39+09:00https://nafiesl.github.io/SimpleCrudGenerator/2021-01-19T19:41:00+08:00https://nafiesl.github.io/SimpleCrudGenerator/docs/relatedcontent/2020-01-28T00:39:09+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/pageresources/2020-01-28T00:39:06+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/pagebundles/2020-01-28T00:38:59+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/contentfortmats/2020-01-28T00:38:51+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/imageprocessing/2020-01-28T00:38:48+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/contentmanagement/shortcodes/2020-01-28T00:36:19+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/contentmanagement/frontmatter/2020-01-28T00:36:14+09:00https://nafiesl.github.io/SimpleCrudGenerator/updates/2020-01-28T00:08:29+09:00https://nafiesl.github.io/SimpleCrudGenerator/docs/2020-01-11T14:09:21+09:00https://nafiesl.github.io/SimpleCrudGenerator/blog/2019-03-11T00:00:00+00:00https://nafiesl.github.io/SimpleCrudGenerator/tags/css/2019-03-11T00:00:00+00:00https://nafiesl.github.io/SimpleCrudGenerator/tags/html/2019-03-11T00:00:00+00:00https://nafiesl.github.io/SimpleCrudGenerator/tags/markdown/2019-03-11T00:00:00+00:00https://nafiesl.github.io/SimpleCrudGenerator/blog/markdown-syntax/2019-03-11T00:00:00+00:00https://nafiesl.github.io/SimpleCrudGenerator/docs/contentmanagement/sections/2019-03-11T00:00:00+00:00https://nafiesl.github.io/SimpleCrudGenerator/tags/themes/2019-03-11T00:00:00+00:00https://nafiesl.github.io/SimpleCrudGenerator/tags/privacy/2019-03-10T00:00:00+00:00https://nafiesl.github.io/SimpleCrudGenerator/blog/rich-content/2019-03-10T00:00:00+00:00https://nafiesl.github.io/SimpleCrudGenerator/tags/shortcodes/2019-03-10T00:00:00+00:00https://nafiesl.github.io/SimpleCrudGenerator/blog/placeholder-text/2019-03-09T00:00:00+00:00https://nafiesl.github.io/SimpleCrudGenerator/tags/text/2019-03-09T00:00:00+00:00https://nafiesl.github.io/SimpleCrudGenerator/tags/emoji/2019-03-05T00:00:00+00:00https://nafiesl.github.io/SimpleCrudGenerator/blog/emoji-support/2019-03-05T00:00:00+00:00 \ No newline at end of file +https://nafiesl.github.io/SimpleCrudGenerator/docs/about/2021-01-30T21:00:00+08:00https://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-install/2021-01-30T21:00:00+08:00https://nafiesl.github.io/SimpleCrudGenerator/docs/how-to-use/2021-01-30T21:00:00+08:00https://nafiesl.github.io/SimpleCrudGenerator/docs/available-commands/2021-01-30T21:00:00+08:00https://nafiesl.github.io/SimpleCrudGenerator/docs/model-attributes/2021-01-30T21:00:00+08:00https://nafiesl.github.io/SimpleCrudGenerator/docs/views/2021-01-30T21:00:00+08:00https://nafiesl.github.io/SimpleCrudGenerator/docs/for-api/2021-01-30T21:00:00+08:00https://nafiesl.github.io/SimpleCrudGenerator/docs/config-file/2021-01-30T21:00:00+08:00https://nafiesl.github.io/SimpleCrudGenerator/docs/publishing-the-stub-files/2021-01-30T21:00:00+08:00https://nafiesl.github.io/SimpleCrudGenerator/docs/screenshots/2021-01-30T21:00:00+08:00https://nafiesl.github.io/SimpleCrudGenerator/docs/generated-testing-suite/2021-01-30T21:00:00+08:00https://nafiesl.github.io/SimpleCrudGenerator/docs/license/2021-01-30T21:00:00+08:00https://nafiesl.github.io/SimpleCrudGenerator/docs/2021-01-30T21:00:00+08:00https://nafiesl.github.io/SimpleCrudGenerator/2021-01-19T19:41:00+08:00 \ No newline at end of file