PHP code example of inventas / momentum-modal

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

    

inventas / momentum-modal example snippets


use Inertia\Inertia;

Route::get('/users/{user}', ShowUser::class)
    ->name('users.show');

Route::get('/users/{user}/tweets/{tweet}', ShowTweet::class)
    ->name('users.tweets.show');

final class ShowTweet
{
    public function __invoke(User $user, Tweet $tweet)
    {
        return Inertia::modal('Tweets/Show', [
            'user' => $user,
            'tweet' => $tweet,
        ])->baseRoute(
            name: 'users.show',
            parameters: $user,
        );
    }
}