0
http://localhost:8000/image/https://pbs.twimg.com/profile_images/443395572783800322/nXTuit5o.jpeg

i want to pass url to the route like this

ROute is like this

Route::get('/image/{url}','ImageController@uploadImageViaUrl');

2 Answers 2

1

Instead of using this BAD practice

http://localhost:8000/image/https://pbs.twimg.com/profile_images/443395572783800322/nXTuit5o.jpeg

Consider to use

http://localhost:8000/image?link=https://pbs.twimg.com/profile_images/443395572783800322/nXTuit5o.jpeg

In routes.php

Route::get('/image','ImageController@uploadImageViaUrl');

In that Controller you can get img url

$img_link = request()->query('link');
Sign up to request clarification or add additional context in comments.

2 Comments

ReflectionException in Container.php line 734: Class App\Http\Controllers\ImageContoller does not exist it is giving me ths error
@AniketKarne It's ImageController not ImageContoller. Make sure it exist in App\Http\Controllers
0

I don't think it's possible like that, because basically youre extending the route with all the slashes in it. After the https part in your image url you have 5 more slashes which would give your route the following weird pattern:

Route::get('/image/{url}/{someting?!}/{someting?!}/{someting?!}/...', 'ImageController@uploadImageViaUrl');

Concider using POST requests for uploading images, maybe this post will help?

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.