PHP code example of alnutile / inertia-crud

1. Go to this page and download the library: Download alnutile/inertia-crud 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/ */

    

alnutile / inertia-crud example snippets

 
Route::controller(\App\Http\Controllers\DogController::class)
    ->group(function () {
        Route::get('/dogs', 'index')->name('dogs.index');
        Route::get('/dogs/create', 'create')->name('dogs.create');
        Route::post('/dogs/create', 'store')->name('dogs.store');
        Route::get('/dogs/{dog}', 'show')->name('dogs.show');
        Route::get('/dogs/{dog}/edit', 'edit')->name('dogs.edit');
        Route::put('/dogs/{dog}', 'update')->name('dogs.update');
    });

 
Route::controller(\App\Http\Controllers\OfficeController::class)
    ->group(function () {
        Route::get('/offices', 'index')->name('offices.index');
        Route::get('/offices/create', 'create')->name('offices.create');
        Route::post('/offices/create', 'store')->name('offices.store');
        Route::get('/offices/{office}', 'show')->name('offices.show');
        Route::get('/offices/{office}/edit', 'edit')->name('offices.edit');
        Route::put('/offices/{office}', 'update')->name('offices.update');
    });
bash 
php artisan inertia-crud:create Dog Dogs
bash 
php artisan inertia-crud:create Dog Dogs