What does the Storage folder in the Laravel do?

Asked

Viewed 538 times

-1

In the Laravel installation, the Storage folder appears, but I never knew the real function of it. Also common is a folder of the same name in the opencart CMS.

1 answer

0


Replies to @Felipe-moereira and @Tiago-luz are incomplete.

Yes the Storage post allows the management of uploads and file manipulation, this in the subfolder app, but in its structure you find other subfolders for other purposes.

A complete description

The storage directory (Storage)

The Storage directory contains your compiled Blade templates, file-based sessions, file caches, and other files generated by the structure. This directory is segregated into application (app) directories, structures (framework) and logs.

  • The app directory (app) can be used to store any files generated by your app.
  • The structure directory (framework) is used to store files and caches generated by the framework.
  • the log directory contains the log files (error, debug, info) of your application.

The directory storage/app/public can be used to store user generated files, such as profile avatars, which must be accessible to the public. You should create a symbolic link in public/storage which points to this directory.

This link can be created using the command php artisan storage:link.

Note that from experience, I suggest creating the link manually on Linux consoles using ln -s /caminho/completo/ate/sistema/storage/app/public /caminho/completo/ate/sistema/public/storage

Links to Laravel documentation (v.8)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.