how to pass URL String as parameter to Laravel routing

Posted 6 months 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.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.