Why Storage Class doesn't have a storage() helper function ITS A NEED!! :D

Posted 1 year ago by skeith22

I'm lately creating a project that involves uploading a lot of files and displaying them specially images.

its kinda bothersome that you need to include

use Illuminate\Support\Facades\Storage

in almost all of your controllers cause you need the function

Storage::url()

for you to display images in your view cause you need to generate the url for it. Instead of using a helper. If we have

storage()->url()

we don't need to include

use Illuminate\Support\Facades\Storage

we could just use the storage() helper function to generate the url in the views to pull files in the Storage.

It would really be nice and helpful to have a storage() helper function.

I'm referring to generating the url for the file.

If anyone encountered this you guys could just include the

use Illuminate\Support\Facades\Storage

in the Controller Class which is being extended by all Controllers

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.