INFO
Dokumentasi Bahasa Indonesia akan segera tersedia, kamu dapat membantu kami menyusun dokumentasi disini.
What's New? โ
Changes in the Latest Version โ
(#79) โ๏ธ Laravel 12 Support, now compatible with Laravel 12.
(#59) ๐ Fixed issue with password input rendering in forms.
(#60) โ๏ธ Corrected grammar and sentence structure.
(#62) ๐งฉ Fixed unhandled match case for value '0'.
(#85) โ Fixed inability to create new submenu items.
(#71) ๐ Fixed typo: "telepon" โ "telephone".
(#57) ๐งผ Replaced
str_replace()
with a custom, more robust function.(#64) ๐ฆ Made Intervention/Image an optional dependency.
๐ Introduced new
ImageServiceV2()
class for better image handling.๐งน Refactored
ViewServiceProvider
for cleaner structure.โ๏ธ Added new
generator.image
config for image settings.๐ธ Change default image configuration from placeholder.com to placehold.co.
For the most recent and complete changelog, please visit Github Releases
How to Update โ
Update
Generator
shcomposer require evdigiina/generator:^0.4.0 --dev
Publish new
ImageService
class.shphp artisan generator:publish-image-service-v2
Install latest version of Intervention Image.
shcomposer require intervention/image-laravel
In
App\Providers\ViewComposerServiceProvider.php
importViewContract
phpuse Illuminate\Contracts\View\View as ViewContract;
Changes in
generator.image
config.generator.image.disk
frompublic
tostorage
.generator.image.default
from https://via.placeholder.com/350?text=No+Image+Available to https://placehold.co/300?text=No+Image+Available
For additional information on these changes, go here.
New Features ๐ฅ โ
New features added in Generator v0.4.x:
โ๏ธ Laravel 12 Support
Now compatible with Laravel 12.๐งพ Export to Excel (Beta)
Added support for exporting data to Excel.๐ท๏ธ Named Parameters in Generated Code
Improves readability and maintainability of generated code.๐จ Color Input Rendering
Displays color preview in index and show pages if input type is color.โ Boolean Icon Rendering
Automatically adds icon for boolean fields in index and show pages.๐ Role & User Resource APIs
Adds RESTful API resources for managing roles and users.๐ผ๏ธ Image Casting on Model
Adds native support for handling images using custom model casts.๐ฉน Update option in the configuration
generator.image.disk
, previously known aspublic
,storage
,s3
, you can now selectpublic
,local
,public_path
ors3
.Here's an example.
/**
* If any input file(image) as default will use options below.
*/
'image' => [
/**
* Path for store the image.
*
* Available options:
* 1. public or storage.public
* 2. local or storage.local
* 3. public_path
* 4. S3
*/
'disk' => 'public',
// other configuration codes.
]
If you want to see the default latest configuration, it is below:
return [
/**
* If any input file(image) as default will use options below.
*/
'image' => [
/**
* Path for store the image.
*
* Available options:
* 1. public or storage.public
* 2. local or storage.local
* 3. public_path
* 4. S3
*/
'disk' => 'public',
/**
* Will be used if image is nullable and default value is null.
*/
'default' => 'https://placehold.co/300?text=No+Image+Available',
/**
* Crop the uploaded image using intervention image.
*/
'crop' => true,
/**
* When set to true the uploaded image aspect ratio will still original.
*/
'aspect_ratio' => true,
/**
* Crop image size.
*/
'width' => 300,
'height' => 300,
],
'format' => [
/**
* Will be used to first year on select, if any column type year.
*/
'first_year' => 1970,
/**
* If any date column type will cast and display used this format, but for input date still will used Y-m-d format.
*
* another most common format:
* - M d Y
* - d F Y
* - Y m d
*/
'date' => 'Y-m-d',
/**
* If any input type month will cast and display used this format.
*/
'month' => 'Y/m',
/**
* If any input type time will cast and display used this format.
*/
'time' => 'H:i',
/**
* If any datetime column type or datetime-local on input, will cast and display used this format.
*/
'datetime' => 'Y-m-d H:i:s',
/**
* Limit string on index view for any column type text or long text.
*/
'limit_text' => 100,
],
/**
* It will be used for generator to manage and showing menus on sidebar views.
*
* Example:
* [
* 'header' => 'Main',
*
* // All permissions in menus[] and submenus[]
* 'permissions' => ['test view'],
*
* menus' => [
* [
* 'title' => 'Main Data',
* 'icon' => '<i class="bi bi-collection-fill"></i>',
* 'route' => null,
*
* // permission always null when isset submenus
* 'permission' => null,
*
* // All permissions on submenus[] and will empty[] when submenus equals to []
* 'permissions' => ['test view'],
*
* 'submenus' => [
* [
* 'title' => 'Tests',
* 'route' => '/tests',
* 'permission' => 'test view'
* ]
* ],
* ],
* ],
* ],
*
* This code below always changes when you use a generator, and maybe you must format the code.
*/
'sidebars' => [
[
'header' => 'Main',
'permissions' => ['test view'],
'menus' => [
[
'title' => 'Main Data',
'icon' => '<i class="bi bi-collection-fill"></i>',
'route' => null,
'permission' => null,
'permissions' => ['test view'],
'submenus' => [
[
'title' => 'Tests',
'route' => '/tests',
'permission' => 'test view',
],
],
],
],
],
[
'header' => 'Users',
'permissions' => ['user view', 'role & permission view'],
'menus' => [
[
'title' => 'Users',
'icon' => '<i class="bi bi-people-fill"></i>',
'route' => '/users',
'permission' => 'user view',
'permissions' => [],
'submenus' => [],
],
[
'title' => 'Roles & permissions',
'icon' => '<i class="bi bi-person-check-fill"></i>',
'route' => '/roles',
'permission' => 'role & permission view',
'permissions' => [],
'submenus' => [],
],
],
],
],
];