PHP code example of ribafs / crud-generator
1. Go to this page and download the library: Download ribafs/crud-generator 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/ */
ribafs / crud-generator example snippets
bash
composer create-project --prefer-dist laravel/laravel crud
cd crud
composer eProvider"
php artisan crud:generate Cadastros --fields='title#string; body#text;' --controller-namespace=App\\Http\\Controllers --form-helper=html
Add ao routes/web.php
Route::resource('/cadastros', 'App\Http\Controllers\CadastrosController');
Executar
php artisan route:clear
php artisan migrate
php artisan serve
http://127.0.0.1:8000/cadastros
Com combo na view
php artisan crud:generate Posts --fields='title#string; content#text; category#select#options={"technology": "Technology", "tips": "Tips", "health": "Health"}' --view-path=admin --controller-namespace=App\\Http\\Controllers\\Admin --route-group=admin --form-helper=html