Skip to content

Commit 24e3bfb

Browse files
committed
Working on structure documentation.
1 parent dafddce commit 24e3bfb

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

structure.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,17 @@ The `vendor` directory contains your Composer dependencies.
3838

3939
The "meat" of your application lives in the `app` directory. By default, this directory is namespaced under `App` and is autoloaded by Composer using the [PSR-4 autoloading standard](http://www.php-fig.org/psr/psr-4/). **You may change this namespace using the `app:name` Artisan command**.
4040

41-
The `app` directory ships with three additional directories: `Console`, `Http`, and `Providers`. Think of the `Console` and `Http` directories as providing an API into the "core" of your application. The HTTP protocol and CLI are both mechanisms to interact with your application, but do not actually contain application logic. In other words, they are simply two ways of issuing commands to your application. The `Console` directory contains all of your Artisan commands, while the `Http` directory contains your controllers, filters, and requests.
41+
The `app` directory ships with a variety of additional directories such as `Console`, `Http`, and `Providers`. Think of the `Console` and `Http` directories as providing an API into the "core" of your application. The HTTP protocol and CLI are both mechanisms to interact with your application, but do not actually contain application logic. In other words, they are simply two ways of issuing commands to your application. The `Console` directory contains all of your Artisan commands, while the `Http` directory contains your controllers, filters, and requests.
42+
43+
The `Commands` directory, of course, houses the commands for your application. Commands represent jobs that can be queued by your application, as well as tasks that you can run synchronously within the current request lifecycle.
44+
45+
The `Events` directory, as you might expect, houses event classes. Of course, using classes to represent events is not required; however, if you choose to use them, this directory is the default location they will be created by the Artisan command line.
46+
47+
The `Handlers` directory contains the handler classes for both commands and events. Handlers receive a command or event, and perform logic in response to that command or event being fired.
48+
49+
The `Services` directory contains various "helper" services your application needs to function. For example, the `Registrar` service that is included with Laravel is responsible for validating and creating new users of your application. Other examples might be services to interact with external APIs, metrics systems, or even services that aggregate data from your own application.
50+
51+
The `Exceptions` directory contains your application's exception handler, and is also a good place to stick any exceptions thrown by your application.
4252

4353
> **Note:** Many of the classes in the `app` directory can be generated by Artisan via commands such as: `make:controller`, `make:filter`, `make:request`, `make:console`, and `make:provider`.
4454

0 commit comments

Comments
 (0)