<a href="{{ url('watch', ['v' => 'youtubeId']) }}">Watch Video</a>
Jun 19, 2018
8
Level 1
how to pass URL String as parameter to Laravel routing
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',"YoutubeController@upload");
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 or to participate in this conversation.