Laravel

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
    1. MUST This word, or the terms “REQUIRED” or “SHALL”, mean that the definition is an absolute requirement of the specification.
    2. MUST NOT This phrase, or the phrase “SHALL NOT”, mean that the definition is an absolute prohibition of the specification.
    3. 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.
    4. 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.
    5. 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.)
    6. 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.
    7. 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.
    8. 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 the app.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 the RouteServiceProvider places in the web middleware group, which provides session state, CSRF protection, and cookie encryption.
    • The api.php file contains routes that the RouteServiceProvider places in the api 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 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 at public/storage which points to this directory. You may create the link using the php artisan storage:link command.
  • The tests Directory, contains your automated tests. An example PHPUnit test is provided out of the box.
  • The vendor Directory, contains your Composer 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 the make:channel command.
  • The Console Directory, contains all of the custom Artisan commands for your application. These commands may be generated using the make:command command.
  • The Events Directory, houses 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 event:generate and make: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 the queueable 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 the event:generate or make:listener.
  • The Mail Directory, contains all of your classes that represent emails sent by your application, created for you if you execute the make: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 the make:notification.
  • The Policies Directory, 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.
  • The Providers Directory, contains all of the service 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 the make:rule. Rules are used to encapsulate complicated validation logic in a simple object.

Requirements

PHP extension, PECL packages, Installation of PECL extensions

Installation

composer global require laravel/installer