PHP code example of mphp / laravel-db2form
1. Go to this page and download the library: Download mphp/laravel-db2form library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mphp / laravel-db2form example snippets
return [
/*
|----------------------------------------------------------------------
| FormRequest Namespace
|----------------------------------------------------------------------
*/
'request_namespace' => 'App\\Http\\Requests',
/*
|----------------------------------------------------------------------
| Blade Output Path
|----------------------------------------------------------------------
*/
'blade_path' => resource_path('views/forms'),
/*
|----------------------------------------------------------------------
| Style Configuration
|----------------------------------------------------------------------
| 'style' => 'bootstrap' or 'custom'
*/
'style' => 'bootstrap', // default style
'bootstrap_styles' => [
'form' => 'needs-validation',
'submit' => 'btn btn-primary',
'label' => 'form-label',
'text' => 'form-control',
'email' => 'form-control',
'password' => 'form-control',
'number' => 'form-control',
'textarea' => 'form-control',
'select' => 'form-select',
'checkbox' => 'form-check-input',
'radio' => 'form-check-input',
],
'custom_styles' => [
'form' => 'space-y-4',
'submit' => 'bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700',
'label' => 'block font-medium mb-1',
'text' => 'border rounded px-3 py-2 w-full',
'email' => 'border rounded px-3 py-2 w-full',
'password' => 'border rounded px-3 py-2 w-full',
'number' => 'border rounded px-3 py-2 w-full',
'textarea' => 'border rounded px-3 py-2 w-full',
'select' => 'border rounded px-3 py-2 w-full',
'checkbox' => 'rounded text-blue-600 focus:ring-blue-500',
'radio' => 'text-blue-600 focus:ring-blue-500',
],
];
sh
php artisan form:generate-json
sh
php artisan form:generate-form
sh
php artisan form:generate
sh
php artisan form:generate-json --tables=users,posts
sh
php artisan form:generate-form
sh
php artisan form:generate
sh
php artisan vendor:publish --tag=form-schema-templates
php artisan vendor:publish --tag=form-schema-config