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
MUST
This word, or the terms “REQUIRED” or “SHALL”, mean that the definition is an absolute requirement of the specification.MUST NOT
This phrase, or the phrase “SHALL NOT”, mean that the definition is an absolute prohibition of the specification.SHOULD
This 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 NOT
This 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.MAY
This 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 Imperatives
Imperatives 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 Considerations
These 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.Acknowledgments
The 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
- Bundles
- Typescript.js
- React.js
- Vue.js
- TDD
Directory Structure
The Root Directory
- The
app
Directory, contains the core code of your application. - The
bootstrap
Directory, contains theapp.php
file which bootstraps the framework, also houses a cache directory which contains framework generated files for performance optimization. - The
config
Directory, contains all of your application’s configuration files. - The
database
Directory, contains your database migrations, model factories, and seeds. - The
public
Directory, contains the index.php file, which is the entry point for all requests entering your application and configures autoloading. This directory also houses your assets such as images, JavaScript, and CSS. - The
resources
Directory, contains your views as well as your raw, un-compiled assets such as LESS, SASS, or JavaScript. This directory also houses all of your language files. - The
routes
Directory, contains all of the route definitions for your application.- The
web.php
file contains routes that theRouteServiceProvider
places in theweb
middleware group, which provides session state, CSRF protection, and cookie encryption. - The
api.php
file contains routes that theRouteServiceProvider
places in theapi
middleware 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. - The
console.php
file 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. - The
channels.php
file is where you may register all of the event broadcasting channels that your application supports.
- The
- The
storage
Directory, contains your compiled Blade templates, file based sessions, file caches, and other files generated by the framework.- The
storage/app/public
directory may be used to store user-generated files, such as profile avatars, that should be publicly accessible. You should create a symbolic link atpublic/storage
which points to this directory. You may create the link using thephp artisan storage:link
command.
- The
- The
tests
Directory, contains your automated tests. An examplePHPUnit
test is provided out of the box. - The
vendor
Directory, contains yourComposer
dependencies.
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.
- The
Broadcasting
Directory, contains all of the broadcast channel classes for your application. These classes are generated using themake:channel
command. - The
Console
Directory, contains all of the custom Artisan commands for your application. These commands may be generated using themake:command
command. - The
Events
Directory, housesevent 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 theevent:generate
andmake:event
. - The
Exceptions
Directory, contains your application’s exception handler and is also a good place to place any exceptions thrown by your application. - The
Http
Directory, contains your controllers, middleware, and form requests. Almost all of the logic to handle requests entering your application will be placed in this directory. - The
Jobs
Directory, houses thequeueable jobs
for your application. Jobs may be queued by your application or run synchronously within the current request lifecycle. - The
Listeners
Directory, contains the classes that handle your events, created for you if you execute theevent:generate
ormake:listener
. - The
Mail
Directory, contains all of your classes that represent emails sent by your application, created for you if you execute themake:mail
. - The
Notifications
Directory, 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 themake:notification
. - The
Policies
Directory, contains the authorization policy classes for your application, created for you if you execute themake:policy
. Policies are used to determine if a user can perform a given action against a resource. - The
Providers
Directory, contains all of theservice providers
for 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. - The
Rules
Directory, contains the custom validation rule objects for your application, created for you if you execute themake:rule
. Rules are used to encapsulate complicated validation logic in a simple object.
Requirements
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
Installation
composer global require laravel/installer