PHP code example of tofandel / inertia-vue-modal
1. Go to this page and download the library: Download tofandel/inertia-vue-modal 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/ */
tofandel / inertia-vue-modal example snippets
namespace App\Http\Middleware;
//...
use Tofandel\InertiaVueModal\HandlesInertiaModalRequest;
class HandleInertiaRequests extends HandlesInertiaModalRequest
{
//...
}
public function store(UserStoreRequest $request)
{
$user = User::create(...);
return redirect()->route('user.show', $user);
}
javascript
this.$inertia.visitInModal('/user/create', {
redirectBack: (evt) => {
// Do something
},
});