public function full_profile($childID, Request $req){
dd($child_id);
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 Profileprofile: 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.
@nutkani1337 happy to help. Please mark a best answer to set the thread as solved :)
Please or to participate in this conversation.