Laravel is a web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
- PSR-4: Autoloader
MUSTThis word, or the terms “REQUIRED” or “SHALL”, mean that the definition is an absolute requirement of the specification.
MUST NOTThis phrase, or the phrase “SHALL NOT”, mean that the definition is an absolute prohibition of the specification.
SHOULDThis word, or the adjective “
RECOMMENDED”, mean that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course.
SHOULD NOTThis phrase, or the phrase “
NOT RECOMMENDED” mean that there may exist valid reasons in particular circumstances when the particular behavior is acceptable or even useful, but the full implications should be understood and the case carefully weighed before implementing any behavior described with this label.
MAYThis word, or the adjective “
OPTIONAL”, mean that an item is truly optional. One vendor may choose to include the item because a particular marketplace requires it or because the vendor feels that it enhances the product while another vendor may omit the same item. An implementation which does not include a particular option MUST be prepared to interoperate with another implementation which does include the option, though perhaps with reduced functionality. In the same vein an implementation which does include a particular option MUST be prepared to interoperate with another implementation which does not include the option (except, of course, for the feature the option provides.)
Guidance in the use of these ImperativesImperatives of the type defined in this memo must be used with care and sparingly. In particular, they MUST only be used where it is actually required for interoperation or to limit behavior which has potential for causing harm (e.g., limiting retransmisssions) For example, they must not be used to try to impose a particular method on implementors where the method is not required for interoperability.
Security ConsiderationsThese terms are frequently used to specify behavior with security implications. The effects on security of not implementing a MUST or SHOULD, or doing something the specification says MUST NOT or SHOULD NOT be done may be very subtle. Document authors should take the time to elaborate the security implications of not following recommendations or requirements as most implementors will not have had the benefit of the experience and discussion that produced the specification.
AcknowledgmentsThe definitions of these terms are an amalgam of definitions taken from a number of RFCs. In addition, suggestions have been incorporated from a number of people including Robert Ullmann, Thomas Narten, Neal McBurnett, and Robert Elz.
- Composer, Install
- Node, NPM
The Root Directory
appDirectory, contains the core code of your application.
bootstrapDirectory, contains the
app.phpfile which bootstraps the framework, also houses a cache directory which contains framework generated files for performance optimization.
configDirectory, contains all of your application’s configuration files.
databaseDirectory, contains your database migrations, model factories, and seeds.
routesDirectory, contains all of the route definitions for your application.
web.phpfile contains routes that the
RouteServiceProviderplaces in the
webmiddleware group, which provides session state, CSRF protection, and cookie encryption.
api.phpfile contains routes that the
RouteServiceProviderplaces in the
apimiddleware group, which provides rate limiting. These routes are intended to be stateless, so requests entering the application through these routes are intended to be authenticated via tokens and will not have access to session state.
console.phpfile is where you may define all of your Closure based console commands. Each Closure is bound to a command instance allowing a simple approach to interacting with each command’s IO methods. Even though this file does not define HTTP routes, it defines console based entry points (routes) into your application.
channels.phpfile is where you may register all of the event broadcasting channels that your application supports.
storageDirectory, contains your compiled Blade templates, file based sessions, file caches, and other files generated by the framework.
storage/app/publicdirectory may be used to store user-generated files, such as profile avatars, that should be publicly accessible. You should create a symbolic link at
public/storagewhich points to this directory. You may create the link using the
php artisan storage:linkcommand.
testsDirectory, contains your automated tests. An example
PHPUnittest is provided out of the box.
vendorDirectory, contains your
The App Directory
The majority of your application is housed in the
app directory. By default, this directory is namespaced under
App and is autoloaded by Composer using the PSR-4 autoloading standard.
BroadcastingDirectory, contains all of the broadcast channel classes for your application. These classes are generated using the
ConsoleDirectory, contains all of the custom Artisan commands for your application. These commands may be generated using the
event classes. 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, created for you by the
ExceptionsDirectory, contains your application’s exception handler and is also a good place to place any exceptions thrown by your application.
HttpDirectory, contains your controllers, middleware, and form requests. Almost all of the logic to handle requests entering your application will be placed in this directory.
JobsDirectory, houses the
queueable jobsfor your application. Jobs may be queued by your application or run synchronously within the current request lifecycle.
ListenersDirectory, contains the classes that handle your events, created for you if you execute the
NotificationsDirectory, contains all of the “transactional” notifications that are sent by your application, such as simple notifications about events that happen within your application, created for you if you execute the
PoliciesDirectory, contains the authorization policy classes for your application, created for you if you execute the
make:policy. Policies are used to determine if a user can perform a given action against a resource.
ProvidersDirectory, contains all of the
service providersfor your application. Service providers bootstrap your application by binding services in the service container, registering events, or performing any other tasks to prepare your application for incoming requests.
RulesDirectory, contains the custom validation rule objects for your application, created for you if you execute the
make:rule. Rules are used to encapsulate complicated validation logic in a simple object.
PHP extension, PECL packages, Installation of PECL extensions
- PHP >= 7.2.5
- BCMath PHP Extension
- Ctype PHP Extension
- Fileinfo PHP extension
- JSON PHP Extension
- Mbstring PHP Extension
- OpenSSL PHP Extension
- PDO PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension
composer global require laravel/installer