How to pass route param while using Inertia manual visit

How can I pass the route param while using Inertia manual visit, for example:

Route:

Route::post('/explore/gallery/like/{$post}', [ExploreController::class, 'likeToggle'])
    ->name('explore.post.like');

Component:

Inertia.visit(route('explore.post.like'),
                {
                    method: 'post',
                    preserveScroll: true,
                    data: {
                        $post: this.id
                    },
                },
            );

but is shows the error tho,

enter image description here



Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation