Handlers receive an event and perform logic in response to the event being fired. The Listeners directory contains the handler classes for your events. Jobs may be queued by your application or run synchronously within the current request lifecycle. The Jobs directory, of course, houses the queueable jobs for your application. The Exceptions directory contains your application's exception handler and is also a good place to stick any exceptions thrown by your application. Events may be used to alert other parts of your application that a given action has occurred, providing a great deal of flexibility and decoupling. The Events directory, as you might expect, houses event classes. The Console directory contains all of your Artisan commands, while the Http directory contains your controllers, middleware, and requests. In other words, they are simply two ways of issuing commands to your application. The HTTP protocol and CLI are both mechanisms to interact with your application, but do not actually contain application logic. Think of the Console and Http directories as providing an API into the "core" of your application. The app directory ships with a variety of additional directories such as Console, Http, and Providers. By default, this directory is namespaced under App and is autoloaded by Composer using the PSR-4 autoloading standard. The "meat" of your application lives in the app directory. The vendor directory contains your Composer dependencies. An example PHPUnit is provided out of the box. The tests directory contains your automated tests. Finally, the logs directory contains your application's log files. The framework directory is used to store framework generated files and caches. The app directory may be used to store any files utilized by your application. This directory is segregated into app, framework, and logs directories. The storage directory contains compiled Blade templates, file based sessions, file caches, and other files generated by the framework. The resources directory contains your views, raw assets (LESS, SASS, CoffeeScript), and localization files. The public directory contains the front controller and your assets (images, JavaScript, CSS, etc.). If you wish, you may also use this directory to hold an SQLite database. The database directory contains your database migration and seeds. The config directory, as the name implies, contains all of your application's configuration files. The bootstrap directory contains a few files that bootstrap the framework and configure autoloading, as well as a cache directory that contains a few framework generated files for bootstrap performance optimization. We'll explore this directory in more detail soon. The app directory, as you might expect, contains the core code of your application. The root directory of a fresh Laravel installation contains a variety of directories: Laravel imposes almost no restrictions on where any given class is located - as long as Composer can autoload the class. Of course, you are free to organize your application however you like. The default Laravel application structure is intended to provide a great starting point for both large and small applications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |