How do you get the path to the Laravel Storage folder

0 votes
I want to store uploaded images to my Laravel-based web app in a subdirectory of the Laravel storage directory. It's the directory at the same hierarchy level as the 'application' and 'public' directories.

Is there a framework method for doing this?
Sep 11, 2020 in Laravel by kartik
• 37,520 points
9,742 views

1 answer to this question.

0 votes

Hello @kartik,

In Laravel 3, call path('storage').

In Laravel 4, use the storage_path() helper function.

For Laravel 5.x, use $storage_path = storage_path().

Hope it helps!!
Thank you!

answered Sep 11, 2020 by Niroj
• 82,840 points

Related Questions In Laravel

0 votes
1 answer

How do I write to the console from a Laravel Controller?

Hello @kartik, This can be done with the ...READ MORE

answered Oct 29, 2020 in Laravel by Niroj
• 82,840 points
837 views
0 votes
1 answer

How to get the subdomain in a subdomain-route in laravel?

Hello, $subdomain is injected in the actual Route callback, it is ...READ MORE

answered Nov 2, 2020 in Laravel by Niroj
• 82,840 points
6,324 views
0 votes
1 answer

How to get the server IP with Laravel?

Hello @kartik, You can use request object: request()->server('SERVER_ADDR'); Or you ...READ MORE

answered Nov 2, 2020 in Laravel by Niroj
• 82,840 points
4,381 views
0 votes
1 answer

How to get the Last Inserted Id Using Laravel Eloquent?

Hello @kartik, Firstly create an object, Then set ...READ MORE

answered Nov 11, 2020 in Laravel by Niroj
• 82,840 points
886 views
0 votes
1 answer

How to specify a port to run a create-react-app based project?

Hello @kartik, You could use cross-env to set the port, ...READ MORE

answered Jul 22, 2020 in Angular by Niroj
• 82,840 points
5,935 views
0 votes
1 answer

How to unset or remove a collection element after fetching it?

Hello @kartik, You would want to use ->forget() $collection->forget($key); Hope it ...READ MORE

answered Sep 11, 2020 in Laravel by Niroj
• 82,840 points
9,689 views
0 votes
1 answer

How to get the id when you're validating in the model Validation unique on update using laravel?

Hello @kartik, in Laravel's inbuilt auth system, the ...READ MORE

answered Sep 11, 2020 in Laravel by Niroj
• 82,840 points
6,736 views
0 votes
1 answer

How to access PHP var from external javascript file?

Hello @kartik, You don't really access it, you ...READ MORE

answered Jul 6, 2020 in Java-Script by Niroj
• 82,840 points
7,827 views
0 votes
1 answer

How to identify wheather the request is HTTP GET or HTTP POST in Laravel?

Hey, In order to identify the type of ...READ MORE

answered Mar 19, 2020 in Laravel by Niroj
• 82,840 points
3,306 views
0 votes
1 answer

How do I write to the console from a Laravel Controller?

Hello @kartik, This can be done with the ...READ MORE

answered Aug 11, 2020 in Laravel by Niroj
• 82,840 points
7,465 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP