1 year ago

how to pass URL String as parameter to Laravel routing

Posted 1 year ago by badr

Hi , I have stuck on a problem in Laravel

I want to pass parameter with question mark , firstly I got question mark problem in URL but I solved by using

public function upload(Request $request)
return $request->query('v');

Route::get('/watch',"[email protected]");

for me the previous solution : the link will accept any URL like "locahost:8000/watch?v=youtubeId"

but the problem is when instead of youtube id I pass youtube video link ? what can I do ?

previous solution dosn't accept slash like


or http://localhost:8000/watch?v=

how to solve this issue ? honestly I'm converting a project to laravel and it was fine with pure php

more info : I have input , And the parameter coming from user not from me, I only need to get what he type,


Please sign in or create an account to participate in this conversation.