badr

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

 http://localhost:8000/watch?v=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dq9FE7uNvvIk

or http://localhost:8000/watch?v=https://www.youtube.com/watch?v=q9FE7uNvvIk

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,

thanks

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

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.