From 6a7694548785b270d87ccd200a539ec6b67aa9b0 Mon Sep 17 00:00:00 2001
From: Mohammad Zulfahmi Generator is a Laravel-based open-source toolkit for building basic needs for administration interface setup like Create, Read, Update, and Delete. It's the minimalistic template or a starting point for developing CMS system, admin panel, or any other web application that requires CRUD functionality. We have a bit of time to build master main data over and over again, therefore this package may let you focus on your core features application, Instead, you might use that time to sleep, play video games, or, since it's Ramadhan, pray to Allah \ufdfb and Prophet Muhammad \ufdfa Currently, we don't have any upgrade guide for this time. But, we will make it soon if we have any breaking changes. Enjoy! We're just bunch of people working on side project (freelance) developer based in Bekasi, Indonesia. We want to make a difference in the world by helping people making their own projects via open source and free software such like our creation. Nope, it's 100% free & open source. MIT. Space is available, lmao. Thank you to all our fellow contributors. Install Generator Variants (Simple/Full Version) For simple version Things that we want to add in
-
+
+
-
+
diff --git a/site/getting_started/index.html b/site/getting_started/index.html
index 9e8d6d1..b4e8a4e 100644
--- a/site/getting_started/index.html
+++ b/site/getting_started/index.html
@@ -18,8 +18,9 @@
+
-
+
@@ -27,15 +28,18 @@
-
+
-
+
+
+
+
@@ -68,9 +72,6 @@
-
-
-
@@ -86,6 +87,10 @@
+
+
+
+
+
+
+
Full Version
-
+
+
-
+
diff --git a/site/how_to_contribute/index.html b/site/how_to_contribute/index.html
index 614d291..322d047 100644
--- a/site/how_to_contribute/index.html
+++ b/site/how_to_contribute/index.html
@@ -18,8 +18,9 @@
+
-
+
@@ -27,15 +28,18 @@
-
+
-
+
+
+
+
@@ -68,24 +72,20 @@
-
-
-
+
+
+
+
+
+
Contributors
-
+
+
-
+
diff --git a/site/search/search_index.json b/site/search/search_index.json
index 1598020..d03e8fd 100644
--- a/site/search/search_index.json
+++ b/site/search/search_index.json
@@ -1 +1 @@
-{"config":{"lang":["en"],"separator":"[\\s\\-,:!=\\[\\]()\"`/]+|\\.(?!\\d)|&[lg]t;|(?!\\b)(?=[A-Z][a-z])","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Home","text":"
"},{"location":"features/#full-version","title":"Full Version","text":"
string, char, date, year
, etc.required, in, image, min, max, string, email, number, date, exists, nullable, unique, comfirmed
"},{"location":"features/#avaiable-commands","title":"Avaiable Commands","text":""},{"location":"features/#install-the-generator","title":"Install The Generator","text":"
For full verion php artisan generator:install simple
php artisan generator:install full
Warning! That will overwrite several files, so use caution while using this command and avoid using it more than once.
"},{"location":"features/#set-the-sidebar-menu","title":"Set the sidebar menu","text":"Set the sidebar menu to fully blade code (static) or use a list from config (dynamic)
Sidebar configuration place in config/generator.php
php artisan generator:sidebar dynamic
While using static sidebar menu, you feel free to edit the sidebar menus on resources/views/layouts/sidebar.blade.php
php artisan generator:sidebar static
After you create a new module using the generator, sidebar will automatically comeback to set dynamic
"},{"location":"features/#utilitieshelpers","title":"Utilities/Helpers","text":""},{"location":"features/#check-sidebar-active-menus","title":"Check sidebar active menus","text":"is_active_menu(string|array $menu): boolean;
"},{"location":"features/#utility-class","title":"Utility class","text":"All utility functions that you maybe need, are available in EvdigiIna\\Generator\\Generators\\GeneratorUtils
use EvdigiIna\\Generator\\Generators\\GeneratorUtils;\n\n/**\n* Get template/stub file.\n*\n* @param string $path\n* @return string\n*/\nGeneratorUtils::getTemplate(string $path): string\n\n/**\n* Check folder if doesnt exist, then make folder.\n*\n* @param string $path\n* @return void\n*/\nGeneratorUtils::checkFolder(string $path): void\n\n/**\n* Convert string to singular pascal case.\n*\n* @param string $string\n* @return string\n*/\nGeneratorUtils::singularPascalCase(string $string): string\n\n/**\n* Convert string to singular pascal case.\n*\n* @param string $string\n* @return string\n*/\nGeneratorUtils::pascalCase(string $string): string\n\n/**\n* Convert string to plural pascal case.\n*\n* @param string $string\n* @return string\n*/\nGeneratorUtils::pluralPascalCase(string $string): string\n\n/**\n* Convert string to plural snake case.\n*\n* @param string $string\n* @return string\n*/\nGeneratorUtils::pluralSnakeCase(string $string): string\n\n/**\n* Convert string to singular snake case.\n*\n* @param string $string\n* @return string\n*/\nGeneratorUtils::singularSnakeCase(string $string): string\n\n/**\n* Convert string to plural pascal case.\n*\n* @param string $string\n* @return string\n*/\nGeneratorUtils::pluralCamelCase(string $string): string\n\n/**\n* Convert string to singular pascal case.\n*\n* @param string $string\n* @return string\n*/\nGeneratorUtils::singularCamelCase(string $string): string\n\n/**\n* Convert string to plural, kebab case, and lowercase.\n*\n* @param string $string\n* @return string\n*/\nGeneratorUtils::pluralKebabCase(string $string): string\n\n/**\n* Convert string kebab case, and lowercase.\n*\n* @param string $string\n* @return string\n*/\nGeneratorUtils::kebabCase(string $string): string\n\n/**\n* Convert string to singular, kebab case, and lowercase.\n*\n* @param string $string\n* @return string\n*/\nGeneratorUtils::singularKebabCase(string $string): string\n\n/**\n* Convert string to singular, remove special caracters, and lowercase.\n*\n* @param string $string\n* @return string\n*/\nGeneratorUtils::cleanSingularLowerCase(string $string): string\n\n/**\n* Remove special caracters, and lowercase.\n*\n* @param string $string\n* @return string\n*/\nGeneratorUtils::cleanLowerCase(string $string): string\n\n/**\n* Convert string to plural, remove special caracters, and uppercase every first letters.\n*\n* @param string $string\n* @return string\n*/\nGeneratorUtils::cleanPluralUcWords(string $string): string\n\n/**\n* Convert string to singular, remove special caracters, and uppercase every first letters.\n*\n* @param string $string\n* @return string\n*/\nGeneratorUtils::cleanSingularUcWords(string $string): string\n\n/**\n* Remove special caracters, and uppercase every first letters.\n*\n* @param string $string\n* @return string\n*/\nGeneratorUtils::cleanUcWords(string $string): string\n\n/**\n* Convert string to plural, remove special caracters, and lowercase.\n*\n* @param string $string\n* @return string\n*/\nGeneratorUtils::cleanPluralLowerCase(string $string): string\n\n/**\n* Get 1 column after id on the table.\n*\n* @param string $table\n* @return string $column\n*/\nGeneratorUtils::getColumnAfterId(string $table): string\n\n/**\n* Select id and column after id on the table.\n*\n* @param string $table\n* @return string $selectedField\n*/\nGeneratorUtils::selectColumnAfterIdAndIdItself(string $table): string\n\n/**\n* Converts camelCase string to have spaces between each.\n*\n* @param string $string\n* @return string\n*/\nGeneratorUtils::fromCamelCase(string $string): string\n\n/**\n* Set model name from the latest of array(if exists).\n*\n* @param string $model\n* @param string $style\n* @return string\n*/\nGeneratorUtils::setModelName(string $model, string $style = 'pascal case'): string\n\n/**\n* Set default image and code to controller.\n*\n* @param null|string $default,\n* @param string $field\n* @param string $model\n* @return array\n*/\nGeneratorUtils::setDefaultImage(null|string $default, string $field, string $model): array\n\n/**\n* Convert array from config to string like array.\n*\n* @param array $idebars\n* @return string\n*/\nGeneratorUtils::convertArraySidebarToString(array $sidebars): string
"},{"location":"features/#things-that-we-want-to-add-in-the-future","title":"Things that we want to add in the future","text":"The list is subject to change at any time and features may be added in any order.
"},{"location":"getting_started/","title":"Getting Started","text":""},{"location":"getting_started/#requirements","title":"Requirements","text":"All you need is Composer, PHP ^8.1, and Laravel ^9.x.
"},{"location":"getting_started/#installation","title":"Installation","text":"composer require evdigiina/generator --dev
For this package, there are two variations: Simple Version and Full Version
"},{"location":"getting_started/#simple-version","title":"Simple Version","text":"Only the generator, includes: Yajra Datatables, Intervention Image, and Bootstrap 5.
View all features
Publish assets
php artisan generator:install simple
Register the provider in config/app.php
/*\n* Package Service Providers...\n*/\nApp\\Providers\\ViewComposerServiceProvider::class,
Then goes to /simple-generators/create/
The generator + starter app, includes: Yajra Datatables, Intervention Image, Laravel Fortify, Spatie Permission, and Mazer Template.
View all features.
Installing this package after a brand-new Laravel installation is necessary if you want to use the full version of it. because several files will be overwritten.
Install Laravel Fortify & Spatie Permission
composer require laravel/fortify spatie/laravel-permission
Publish assets
php artisan generator:install full
Warning! Be careful with this command, it will overwrite several files, don't run it multiple times.
Register the provider in config/app.php
/*\n* Package Service Providers...\n*/\n\nApp\\Providers\\FortifyServiceProvider::class,\nSpatie\\Permission\\PermissionServiceProvider::class,\nApp\\Providers\\ViewComposerServiceProvider::class,
Run migration and seeder
php artisan migrate --seed
Then goes to /generators/create
Account
Star the repository
"},{"location":"how_to_contribute/#coming-soon","title":"Coming soon","text":""},{"location":"sponsors/","title":"Sponsors / Supporters","text":""},{"location":"sponsors/#become-a-sponsor-supporter","title":"Become a sponsor / supporter","text":"Generator is an MIT-licensed open-source project and is completely free to use. The tremendous amount of effort needed to maintain and develop new features for the project is only made sustainable thanks to the generous financial backing of our sponsors or supporters.
"},{"location":"sponsors/#give-it-personally-to-our-core-team-member","title":"Give it personally to our core team member","text":"Your company logo will appear on our website and GitHub project READMEs. Furthermore, supporting OSS increases your brand's reputation. To do so, please contact us using the details provided below.
Go to /generators/create
if yo're using Full Version or /simple-generators/create
for Simple Version
Below is table about supported input type & validation when you are using some column type.
Columm Type Input Type Validation Length (min & max)string
text, textarea, email, telephone, password url, search, file, hidden
required|string
\u2705 integer
number, range, hidden
required|numeric
\u2705 text
text, textarea, email, telephone, password url, search, file, hidden
required|string
\u2705 booelan
radio, select, datalist
required|booelan
\u274c char
text, color, week, email, telephone, password url, search, file, hidden
required|string
\u2705 date
date, month
required|date
\u274c time
time
required|date
\u274c year
select, datalist
required|numeric
\u274c dateTime
datetime-local
required|date
\u274c decimal
number, range, hidden
required|numeric
\u274c double
number, range, hidden
required|numeric
\u274c enum
select, readio, datalist
required|in
\u274c float
number, range, hidden
required|numeric
\u274c foreignId
select, datalist
required|exist
\u274c tinyInteger
number, range, hidden
required|numeric
\u274c mediumInteger
number, range, hidden
required|numeric
\u274c bigInteger
number, range, hidden
required|numeric
\u274c tinyText
text, textarea, email, telephone, password url, search, file, hidden
required|string
\u2705 mediumText
text, textarea, email, telephone, password url, search, file, hidden
required|string
\u2705 longText
text, textarea, email, telephone, password url, search, file, hidden
required|string
\u2705 required
validation will change to nullable
if you uncheck required switch in the form, if any input type password
will automatically added confirmed
validation, min:1|max:100
for supported length column and email|unique
for email
input type.
For now is only support One To Many (Inverse) / Belongs To.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id lacus id sem dapibus faucibus. Aenean eu magna sodales augue efficitur porttitor eget a mi. Aenean pulvinar sit amet tellus sit amet placerat. Fusce pulvinar suscipit lacus, ut fermentum nulla efficitur a.
"},{"location":"usage/#create-upload-file","title":"Create Upload File","text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id lacus id sem dapibus faucibus. Aenean eu magna sodales augue efficitur porttitor eget a mi. Aenean pulvinar sit amet tellus sit amet placerat. Fusce pulvinar suscipit lacus, ut fermentum nulla efficitur a.
if you are using storage
for store the image, make sure you run php artisan storage:link
This feature only avaiable in full version.
You can easily create a dynamic sidebar menus with just a few input. all sidebar menus configuration place in config/generator.php
How about i dont need dynamic sidebar menu, i just want create my menu in blade
? yeah we provide it, click here how to do it.
Below is the default config for the generator and sidebar menus:
return [\n /**\n * If any input file(image) as default will used options below.\n */\n 'image' => [\n /**\n * Path for store the image.\n *\n * avaiable options:\n * 1. public\n * 2. storage\n */\n 'path' => 'storage',\n\n /**\n * Will used if image is nullable and default value is null.\n */\n 'default' => 'https://via.placeholder.com/350?text=No+Image+Avaiable',\n\n /**\n * Crop the uploaded image using intervention image.\n */\n 'crop' => true,\n\n /**\n * When set to true the uploaded image aspect ratio will still original.\n */\n 'aspect_ratio' => true,\n\n /**\n * Crop image size.\n */\n 'width' => 500,\n 'height' => 500,\n ],\n\n 'format' => [\n /**\n * Will used to first year on select, if any column type year.\n */\n 'first_year' => 1900,\n\n /**\n * If any date column type will cast and display used this format, but for input date still will used Y-m-d format.\n *\n * another most common format:\n * - M d Y\n * - d F Y\n * - Y m d\n */\n 'date' => 'd/m/Y',\n\n /**\n * If any input type month will cast and display used this format.\n */\n 'month' => 'm/Y',\n\n /**\n * If any input type time will cast and display used this format.\n */\n 'time' => 'H:i',\n\n /**\n * If any datetime column type or datetime-local on input, will cast and display used this format.\n */\n 'datetime' => 'd/m/Y H:i',\n\n /**\n * Limit string on index view for any column type text or longtext.\n */\n 'limit_text' => 100,\n ],\n\n /**\n * It will used for generator to manage and showing menus on sidebar views.\n *\n * Example:\n * [\n * 'header' => 'Main',\n *\n * // All permissions in menus[] and submenus[]\n * 'permissions' => ['test view'],\n *\n * menus' => [\n * [\n * 'title' => 'Main Data',\n * 'icon' => '<i class=\"bi bi-collection-fill\"></i>',\n * 'route' => null,\n *\n * // permission always null when isset submenus\n * 'permission' => null,\n *\n * // All permissions on submenus[] and will empty[] when submenus equals to []\n * 'permissions' => ['test view'],\n *\n * 'submenus' => [\n * [\n * 'title' => 'Tests',\n * 'route' => '/tests',\n * 'permission' => 'test view'\n * ]\n * ],\n * ],\n * ],\n * ],\n *\n * This code below always changes when you use a generator and maybe you must lint or format the code.\n */\n 'sidebars' => [\n [\n 'header' => 'Main',\n 'permissions' => [\n 'test view'\n ],\n 'menus' => [\n [\n 'title' => 'Main Data',\n 'icon' => '<i class=\"bi bi-collection-fill\"></i>',\n 'route' => null,\n 'permission' => null,\n 'permissions' => [\n 'test view'\n ],\n 'submenus' => [\n [\n 'title' => 'Tests',\n 'route' => '/tests',\n 'permission' => 'test view'\n ]\n ]\n ]\n ]\n ],\n [\n 'header' => 'Users',\n 'permissions' => [\n 'user view',\n 'role & permission view'\n ],\n 'menus' => [\n [\n 'title' => 'Users',\n 'icon' => '<i class=\"bi bi-people-fill\"></i>',\n 'route' => '/users',\n 'permission' => 'user view',\n 'permissions' => [],\n 'submenus' => []\n ],\n [\n 'title' => 'Roles & permissions',\n 'icon' => '<i class=\"bi bi-person-check-fill\"></i>',\n 'route' => '/roles',\n 'permission' => 'role & permission view',\n 'permissions' => [],\n 'submenus' => []\n ]\n ]\n ],\n ],\n];\n
"}]}
\ No newline at end of file
+{"config":{"lang":["en"],"separator":"[\\s\\-,:!=\\[\\]()\"`/]+|\\.(?!\\d)|&[lg]t;|(?!\\b)(?=[A-Z][a-z])","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Home","text":"Generator is a Laravel-based open-source toolkit for building basic needs for administration interface setup like Create, Read, Update, and Delete. It's the minimalistic template or a starting point for developing CMS system, admin panel, or any other web application that requires CRUD functionality.
"},{"location":"#the-reason","title":"The Reason","text":"We have a bit of time to build master main data over and over again, therefore this package may let you focus on your core features application, Instead, you might use that time to sleep, play video games, or touch some grass.
"},{"location":"#who-we-are","title":"Who We Are","text":"We're just bunch of people working on side project (freelance) developer based in Bekasi, Indonesia. We want to make a difference in the world by helping people making their own projects via open source and free software such like our creation.
"},{"location":"#pricing","title":"Pricing","text":"Nope, it's 100% free & open source.
"},{"location":"#license","title":"License","text":"MIT.
"},{"location":"#sponsors","title":"Sponsors","text":"Space is available, lmao.
"},{"location":"#contributors","title":"Contributors","text":"Thank you to all our fellow contributors.
"},{"location":"features/","title":"Features","text":""},{"location":"features/#simple-version","title":"Simple Version","text":"
string, char, date, year
, etc.required, in, image, min, max, string, email, number, date, exists, nullable, unique, confirmed
Install Generator Variants (Simple/Full Version)
For simple version
php artisan generator:install simple
For full version php artisan generator:install full
Warning! That will overwrite several files, so use caution while using this command and avoid using it more than once.
"},{"location":"features/#set-the-sidebar-menu","title":"Set the sidebar menu","text":"Set the sidebar menu to fully blade code (static) or use a list from config (dynamic)
Sidebar configuration place in config/generator.php
php artisan generator:sidebar dynamic
While using static sidebar menu, you feel free to edit the sidebar menus on resources/views/layouts/sidebar.blade.php
php artisan generator:sidebar static
After you create a new module using the generator, sidebar will automatically comeback to set dynamic
"},{"location":"features/#utilitieshelpers","title":"Utilities/Helpers","text":""},{"location":"features/#check-sidebar-active-menus","title":"Check sidebar active menus","text":"is_active_menu(string|array $menu): boolean;
"},{"location":"features/#utility-class","title":"Utility class","text":"All utility functions that you maybe need, are available in App\\Generators\\GeneratorUtils
use App\\Generators\\GeneratorUtils;\n\n/**\n * Get template/file.\n*/\npublic static function getTemplate(string $path): string;\n\n/**\n* Get published files.\n*/\npublic static function getPublishedFiles(string $path): string;\n\n/**\n* Check folder if not exist, then make folder.\n*/\npublic static function checkFolder(string $path): void;\n\n/**\n* Convert string to singular pascal case.\n*/\npublic static function singularPascalCase(string $string): string;\n\n/**\n* Convert string to singular pascal case.\n*/\npublic static function pascalCase(string $string): string;\n\n/**\n* Convert string to plural pascal case.\n*/\npublic static function pluralPascalCase(string $string): string;\n\n/**\n* Convert string to plural snake case.\n*/\npublic static function pluralSnakeCase(string $string): string;\n\n/**\n* Convert string to singular snake case.\n*/\npublic static function singularSnakeCase(string $string): string;\n\n/**\n* Convert string to plural pascal case.\n*/\npublic static function pluralCamelCase(string $string): string;\n\n/**\n* Convert string to singular pascal case.\n*/\npublic static function singularCamelCase(string $string): string;\n\n/**\n* Convert string to plural, kebab case, and lowercase.\n*/\npublic static function pluralKebabCase(string $string): string;\n\n/**\n* Convert string to kebab case, and lowercase.\n*/\npublic static function kebabCase(string $string): string;\n\n/**\n* Convert string to singular, kebab case, and lowercase.\n*/\npublic static function singularKebabCase(string $string): string;\n\n/**\n* Convert string to singular, remove special characters, and lowercase.\n*/\npublic static function cleanSingularLowerCase(string $string): string;\n\n/**\n* Remove special characters, and lowercase.\n*/\npublic static function cleanLowerCase(string $string): string;\n\n/**\n* Convert string to plural, remove special characters, and uppercase every first letters.\n*/\npublic static function cleanPluralUcWords(string $string): string;\n\n/**\n* Convert string to singular, remove special characters, and uppercase every first letters.\n*/\npublic static function cleanSingularUcWords(string $string): string;\n\n/**\n* Remove special characters, and uppercase every first letters.\n*/\npublic static function cleanUcWords(string $string): string;\n\n/**\n* Convert string to plural, remove special characters, and lowercase.\n*/\npublic static function cleanPluralLowerCase(string $string): string;\n\n/**\n* Get 1 column after id on the table.\n*/\npublic static function getColumnAfterId(string $table): string;\n\n/**\n* Select id and column after id on the table.\n*/\npublic static function selectColumnAfterIdAndIdItself(string $table): string;\n\n/**\n* Get model location or path if contains '/'.\n*/\npublic static function getModelLocation(string $model): string;\n\n/**\n* Converts camelCase string to have spaces between each.\n*/\npublic static function fromCamelCase(string $string): string;\n/**\n* Set model name from the latest of array(if exists).\n*/\npublic static function setModelName(string $model, string $style = 'pascal case'): string;\n\n/**\n* Set default image and code to controller.\n*/\npublic static function setDefaultImage(null|string $default, string $field, string $model): array;\n\n/**\n* Convert array from config to string like array.\n*/\npublic static function convertArraySidebarToString(array $sidebars): string;\n\n/**\n* Check if menu is active.\n*/\npublic static function isActiveMenu(string|array $route): string;
"},{"location":"features/#things-that-we-want-to-add-in-the-future","title":"Things that we want to add in the future","text":"The list is subject to change at any time and features may be added in any order.
"},{"location":"getting_started/","title":"Getting Started","text":""},{"location":"getting_started/#requirements","title":"Requirements","text":"All you need is Composer, PHP ^8.1, and Laravel ^9.x.
"},{"location":"getting_started/#installation","title":"Installation","text":"composer require evdigiina/generator --dev
For this package, there are two variations: Simple Version and Full Version
"},{"location":"getting_started/#simple-version","title":"Simple Version","text":"Only the generator, includes: Yajra Datatables, Intervention Image, and Bootstrap 5.
View all features
Publish assets
php artisan generator:install simple
Register the provider in config/app.php
/*\n* Package Service Providers...\n*/\nApp\\Providers\\ViewComposerServiceProvider::class,
Then go to /simple-generators/create/
The generator + starter app, includes: Yajra Datatables, Intervention Image, Laravel Fortify, Spatie Permission, and Mazer Template.
View all features.
Installing this package after a brand-new Laravel installation is necessary if you want to use the full version of it. because several files will be overwritten.
Install Laravel Fortify & Spatie Permission
composer require laravel/fortify spatie/laravel-permission
Publish assets
php artisan generator:install full
Warning! Be careful with this command, it will overwrite several files, don't run it multiple times.
Register the provider in config/app.php
/*\n* Package Service Providers...\n*/\n\nApp\\Providers\\FortifyServiceProvider::class,\nSpatie\\Permission\\PermissionServiceProvider::class,\nApp\\Providers\\ViewComposerServiceProvider::class,
Run migration and seeder
php artisan migrate --seed
Then go to /generators/create
Account
To contribute to this project, please follow the following steps:
Star & fork the repository
Create a new laravel project using the following command: composer create-project laravel/laravel generator-dev
or laravel new generator-dev
Install the dependencies using the following command: composer require laravel/fortify spatie/laravel-permission intervention/image \"^2.0\" yajra/laravel-datatables-oracle
Publish fortify
resources php artisan vendor:publish --provider=\"Laravel\\Fortify\\FortifyServiceProvider\"
Create folder packages/evdigi-ina
in the root of the project
Cd into packages/evdigi-ina
, clone the repository git clone https://github.com/Evdigi-INA/generator.git
and install the depedency composer i
then back again into root project
Add the following code to the composer.json
\"autoload\": {\n \"psr-4\": {\n \"App\\\\\": \"app/\",\n \"Database\\\\Factories\\\\\": \"database/factories/\",\n \"Database\\\\Seeders\\\\\": \"database/seeders/\",\n \"EvdigiIna\\\\Generator\\\\\": \"packages/evdigi-ina/generator/src/\"\n }\n},
Run the following command composer dump-autoload
Add the following code to the config/app.php
/*\n* Package Service Providers...\n*/\nEvdigiIna\\Generator\\Providers\\GeneratorServiceProvider::class,\nYajra\\DataTables\\DataTablesServiceProvider::class,\nSpatie\\Permission\\PermissionServiceProvider::class,\nIntervention\\Image\\ImageServiceProvider::class,\nApp\\Providers\\FortifyServiceProvider::class,\n// App\\Providers\\ViewComposerServiceProvider::class,
php artisan generator:install full
composer.json
(autoload files)\"autoload\": {\n \"psr-4\": {\n \"App\\\\\": \"app/\",\n \"Database\\\\Factories\\\\\": \"database/factories/\",\n \"Database\\\\Seeders\\\\\": \"database/seeders/\",\n \"EvdigiIna\\\\Generator\\\\\": \"packages/evdigi-ina/generator/src/\"\n },\n \"files\": [\n \"App/Generators/helper.php\"\n ]\n},
Uncomment App\\Providers\\ViewComposerServiceProvider::class
in config/app.php
Then run composer dump-autoload
for a second time
Migrate the database php artisan migrate --seed
Run local development server php artisan serve
and go to /generators/create
Make changes code as you wish in packages/evdigi-ina/generator
.
Make sure the code is working properly
Checkout to a new branch git branch your_name
&& git checkout your_name
&& git add .
&& git commit -m \"describe your changes
Push the code to the repository git push origin your_name
Create a pull request.
Generator is an MIT-licensed open-source project and is completely free to use. The tremendous amount of effort needed to maintain and develop new features for the project is only made sustainable thanks to the generous financial backing of our sponsors or supporters.
"},{"location":"sponsors/#give-it-personally-to-our-core-team-member","title":"Give it personally to our core team member","text":"Your company logo will appear on our website and GitHub project READMEs. Furthermore, supporting OSS increases your brand's reputation. To do so, please contact us using the details provided below.
Go to /generators/create
if yo're using Full Version or /simple-generators/create
for Simple Version
Below is table about supported input type & validation when you are using some column type.
Column Type Input Type Validation Length (min & max)string
text, textarea, email, telephone, password url, search, file, hidden
required|string
\u2705 integer
number, range, hidden
required|numeric
\u2705 text
text, textarea, email, telephone, password url, search, file, hidden
required|string
\u2705 boolean
radio, select, datalist
required|boolean
\u274c char
text, color, week, email, telephone, password url, search, file, hidden
required|string
\u2705 date
date, month
required|date
\u274c time
time
required|date
\u274c year
select, datalist
required|numeric
\u274c dateTime
datetime-local
required|date
\u274c decimal
number, range, hidden
required|numeric
\u274c double
number, range, hidden
required|numeric
\u274c enum
select, radio, datalist
required|in
\u274c float
number, range, hidden
required|numeric
\u274c foreignId
select, datalist
required|exist
\u274c tinyInteger
number, range, hidden
required|numeric
\u274c mediumInteger
number, range, hidden
required|numeric
\u274c bigInteger
number, range, hidden
required|numeric
\u274c tinyText
text, textarea, email, telephone, password url, search, file, hidden
required|string
\u2705 mediumText
text, textarea, email, telephone, password url, search, file, hidden
required|string
\u2705 longText
text, textarea, email, telephone, password url, search, file, hidden
required|string
\u2705 required
validation will change to nullable
if you uncheck required switch in the form, if any input type password
will automatically added confirmed
validation, min:1|max:100
for supported length column and email|unique
for email
input type.
For now is only support One To Many (Inverse) / Belongs To.
There is rules you must be followed if you want create a a relation:
_id
, eg: if we have a users
table then it must be a user_id
.foreignId
.nothing, cascade, restrict
nothing, cascade, restrict, null
Make sure the related table & model already exist, if its no then the selected field for showing in select
/datalist
is an id
, by default selected field is second column in related table.
Set column type to string
, input type to file
, select file type (for now only support image), fill the max size(optional), and default value (must be a valid link), also we use Intervention Image for manipulating uploaded image. all setting for images are available at config/generator.php
.
Default image configuration:
'image' => [\n /**\n * Path for store the image.\n *\n * available options:\n * 1. public\n * 2. storage\n */\n 'path' => 'storage',\n\n /**\n * Will used if image is nullable and default value is null.\n */\n 'default' => 'https://via.placeholder.com/350?text=No+Image+available',\n\n /**\n * Crop the uploaded image using intervention image.\n */\n 'crop' => true,\n\n /**\n * When set to true the uploaded image aspect ratio will still original.\n */\n 'aspect_ratio' => true,\n\n /**\n * Crop image size.\n */\n 'width' => 500,\n 'height' => 500,\n],
if you are using storage
for store the image, make sure you run php artisan storage:link
This feature only available in full version.
You can easily create a dynamic sidebar menu with just a few inputs. all sidebar menus configuration are placed in config/generator.php
How about I don't need a dynamic sidebar menu, I just want to create my menu in blade
. yeah, we provide it, click here how to do it.
While you are using the full version, after creating a new module will automatically generate some permissions and assign them to the role admin
. all permissions are stored in config/permission.php
Here an example:
[\n 'group' => 'products',\n 'access' => [\n 'product view',\n 'product create',\n 'product edit',\n 'product delete'\n ]\n],
"},{"location":"usage/#configuration","title":"Configuration","text":"Below is the default config for the generator and sidebar menus:
<?php\n\nreturn [\n /**\n * If any input file(image) as default will used options below.\n */\n 'image' => [\n /**\n * Path for store the image.\n *\n * available options:\n * 1. public\n * 2. storage\n */\n 'path' => 'storage',\n\n /**\n * Will used if image is nullable and default value is null.\n */\n 'default' => 'https://via.placeholder.com/350?text=No+Image+available',\n\n /**\n * Crop the uploaded image using intervention image.\n */\n 'crop' => true,\n\n /**\n * When set to true the uploaded image aspect ratio will still original.\n */\n 'aspect_ratio' => true,\n\n /**\n * Crop image size.\n */\n 'width' => 500,\n 'height' => 500,\n ],\n\n 'format' => [\n /**\n * Will used to first year on select, if any column type year.\n */\n 'first_year' => 1900,\n\n /**\n * If any date column type will cast and display used this format, but for input date still will used Y-m-d format.\n *\n * another most common format:\n * - M d Y\n * - d F Y\n * - Y m d\n */\n 'date' => 'd/m/Y',\n\n /**\n * If any input type month will cast and display used this format.\n */\n 'month' => 'm/Y',\n\n /**\n * If any input type time will cast and display used this format.\n */\n 'time' => 'H:i',\n\n /**\n * If any datetime column type or datetime-local on input, will cast and display used this format.\n */\n 'datetime' => 'd/m/Y H:i',\n\n /**\n * Limit string on index view for any column type text or longtext.\n */\n 'limit_text' => 100,\n ],\n\n /**\n * It will used for generator to manage and showing menus on sidebar views.\n *\n * Example:\n * [\n * 'header' => 'Main',\n *\n * // All permissions in menus[] and submenus[]\n * 'permissions' => ['test view'],\n *\n * menus' => [\n * [\n * 'title' => 'Main Data',\n * 'icon' => '<i class=\"bi bi-collection-fill\"></i>',\n * 'route' => null,\n *\n * // permission always null when isset submenus\n * 'permission' => null,\n *\n * // All permissions on submenus[] and will empty[] when submenus equals to []\n * 'permissions' => ['test view'],\n *\n * 'submenus' => [\n * [\n * 'title' => 'Tests',\n * 'route' => '/tests',\n * 'permission' => 'test view'\n * ]\n * ],\n * ],\n * ],\n * ],\n *\n * This code below always changes when you use a generator and maybe you must lint or format the code.\n */\n 'sidebars' => [\n [\n 'header' => 'Main',\n 'permissions' => [\n 'test view'\n ],\n 'menus' => [\n [\n 'title' => 'Main Data',\n 'icon' => '<i class=\"bi bi-collection-fill\"></i>',\n 'route' => null,\n 'permission' => null,\n 'permissions' => [\n 'test view'\n ],\n 'submenus' => [\n [\n 'title' => 'Tests',\n 'route' => '/tests',\n 'permission' => 'test view'\n ]\n ]\n ]\n ]\n ],\n [\n 'header' => 'Users',\n 'permissions' => [\n 'user view',\n 'role & permission view'\n ],\n 'menus' => [\n [\n 'title' => 'Users',\n 'icon' => '<i class=\"bi bi-people-fill\"></i>',\n 'route' => '/users',\n 'permission' => 'user view',\n 'permissions' => [],\n 'submenus' => []\n ],\n [\n 'title' => 'Roles & permissions',\n 'icon' => '<i class=\"bi bi-person-check-fill\"></i>',\n 'route' => '/roles',\n 'permission' => 'role & permission view',\n 'permissions' => [],\n 'submenus' => []\n ],\n ]\n ],\n ],\n];\n
"},{"location":"usage/#production-setup","title":"Production Setup","text":"Because this package is only installed in development, so some files will not be included in the production environment. so you must do the following steps:
In composer.json
add this code below:
\"autoload\": {\n \"files\": [\n \"App/Generators/helper.php\"\n ]\n},\n\"extra\": {\n \"laravel\": {\n \"aliases\": {\n \"GeneratorUtils\": \"App\\\\Generators\\\\GeneratorUtils\",\n }\n }\n}
Then run composer dump-autoload
.