Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nutkani1337's avatar

How to bind user ID with Link component in Inertiajs/laravel and get it in controller

Hey Folks, I'm new to InertiaJs and I'm facing a little problem. Here is the scenario

1- I have few users on my page when I click the <Link> I want to redirect user to "view full profile" component. 2- In the <Link> I want to bind user ID so that I can use it further in respective controller.

Here is how i'm dong this:

Vue Component

Full Profile
profile: function(ChildID){
        this.$inertia.post("/full_profile/"+ChildID);
    }

========== Route

Route::middleware([ 'auth:sanctum', config('jetstream.auth_session'), 'verified', ])->group(function () { Route::post('/full_profile/{ChildID}', [childrenController::class,'full_profile']); });

============= Controller code

public function full_profile(Request $erq){
   return $req;
   // I want to get that the user ID here
}

Any lead/help would be highly appreciated.

0 likes
3 replies
Sinnbeck's avatar
public function full_profile($childID, Request $req){
     dd($child_id);
1 like

Please or to participate in this conversation.