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,510 points
1,160 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,720 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,720 points
102 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,720 points
991 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,720 points
567 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,720 points
56 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,720 points
2,416 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,720 points
905 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,720 points
1,841 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,720 points
2,282 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,720 points
286 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,720 points
883 views