PHP code example of inertia-volt / laravel-plugin

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

    

inertia-volt / laravel-plugin example snippets


// Welcome.inertia.vue



use function InertiaVolt\Laravel\{render};

render('welcome/{name}', fn(string $name) => [
    'name' => $name,
]);


php artisan vendor:publish --tag=inertia-volt

post('', function (ChirpStoreRequest $request) {
    ...
});

put('{chirp}', function (ChirpStoreRequest $request, Chirp $chirp) {
    ...
})->name('update'); // with model binding and route name