what is the folder that you need to contain the php files
Directory Structure
- Introduction
- The Root Directory
- The
app
Directory - The
bootstrap
Directory - The
config
Directory - The
database
Directory - The
lang
Directory - The
public
Directory - The
resources
Directory - The
routes
Directory - The
storage
Directory - The
tests
Directory - The
vendor
Directory
- The
- The App Directory
- The
Broadcasting
Directory - The
Console
Directory - The
Events
Directory - The
Exceptions
Directory - The
Http
Directory - The
Jobs
Directory - The
Listeners
Directory - The
Mail service
Directory - The
Models
Directory - The
Notifications
Directory - The
Policies
Directory - The
Providers
Directory - The
Rules
Directory
- The
Introduction
The default Laravel application structure is intended to provide a groovy starting point for both large and small applications. But you are free to organize your awarding all the same you lot like. Laravel imposes almost no restrictions on where any given class is located - every bit long equally Composer can autoload the class.
The Root Directory
The App Directory
The app
directory contains the cadre code of your awarding. We'll explore this directory in more detail presently; withal, well-nigh all of the classes in your application will be in this directory.
The Bootstrap Directory
The bootstrap
directory contains the app.php
file which bootstraps the framework. This directory also houses a cache
directory which contains framework generated files for performance optimization such as the route and services cache files. You lot should not typically need to modify whatever files within this directory.
The Config Directory
The config
directory, as the name implies, contains all of your application'southward configuration files. It'southward a great idea to read through all of these files and familiarize yourself with all of the options available to you lot.
The Database Directory
The database
directory contains your database migrations, model factories, and seeds. If y'all wish, you may also use this directory to concur an SQLite database.
The Lang Directory
The lang
directory houses all of your application'south linguistic communication files.
The Public Directory
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 avails such as images, JavaScript, and CSS.
The Resource Directory
The resources
directory contains your views as well as your raw, un-compiled assets such every bit CSS or JavaScript.
The Routes Directory
The routes
directory contains all of the road definitions for your application. Past default, several route files are included with Laravel: web.php
, api.php
, console.php
, and channels.php
.
The spider web.php
file contains routes that the RouteServiceProvider
places in the web
middleware group, which provides session state, CSRF protection, and cookie encryption. If your application does not offer a stateless, RESTful API and then it is likely that all of your routes will most likely exist defined in the web.php
file.
The api.php
file contains routes that the RouteServiceProvider
places in the api
middleware group. These routes are intended to exist stateless, so requests inbound the application through these routes are intended to be authenticated via tokens and will not take access to session country.
The panel.php
file is where you may define all of your closure based console commands. Each closure is bound to a command case allowing a simple approach to interacting with each command's IO methods. Even though this file does not ascertain HTTP routes, it defines console based entry points (routes) into your application.
The channels.php
file is where you may register all of the consequence broadcasting channels that your application supports.
The Storage Directory
The storage
directory contains your logs, compiled Blade templates, file based sessions, file caches, and other files generated by the framework. This directory is segregated into app
, framework
, and logs
directories. The app
directory may be used to store any files generated by your application. The framework
directory is used to store framework generated files and caches. Finally, the logs
directory contains your application'south log files.
The storage/app/public
directory may be used to store user-generated files, such equally profile avatars, that should be publicly accessible. You lot should create a symbolic link at public/storage
which points to this directory. You may create the link using the php artisan storage:link
Artisan control.
The Tests Directory
The tests
directory contains your automatic tests. Example PHPUnit unit tests and feature tests are provided out of the box. Each test class should be suffixed with the word Test
. Yous may run your tests using the phpunit
or php vendor/bin/phpunit
commands. Or, if you lot would like a more detailed and beautiful representation of your examination results, you may run your tests using the php artisan test
Artisan control.
The Vendor Directory
The vendor
directory contains your Composer dependencies.
The App Directory
The majority of your awarding is housed in the app
directory. Past default, this directory is namespaced under App
and is autoloaded by Composer using the PSR-4 autoloading standard.
The app
directory contains a variety of additional directories such as Console
, Http
, and Providers
. Think of the Console
and Http
directories every bit providing an API into the core of your application. The HTTP protocol and CLI are both mechanisms to interact with your application, but practise not really contain awarding logic. In other words, they are 2 means of issuing commands to your application. The Console
directory contains all of your Artisan commands, while the Http
directory contains your controllers, middleware, and requests.
A variety of other directories will exist generated inside the app
directory as you lot employ the make
Artisan commands to generate classes. And then, for case, the app/Jobs
directory volition not be until you execute the brand:job
Artisan command to generate a job class.
{tip} Many of the classes in the
app
directory can be generated past Artisan via commands. To review the available commands, run thephp artisan listing brand
command in your terminal.
The Broadcasting Directory
The Broadcasting
directory contains all of the broadcast channel classes for your awarding. These classes are generated using the make:aqueduct
command. This directory does not exist by default, but will be created for y'all when y'all create your offset channel. To learn more about channels, check out the documentation on event broadcasting.
The Console Directory
The Console
directory contains all of the custom Artisan commands for your application. These commands may be generated using the make:command
command. This directory also houses your panel kernel, which is where your custom Artisan commands are registered and your scheduled tasks are defined.
The Events Directory
This directory does not be past default, but will be created for y'all past the upshot:generate
and make:event
Artisan commands. The Events
directory houses event classes. Events may exist used to alert other parts of your application that a given action has occurred, providing a great deal of flexibility and decoupling.
The Exceptions Directory
The Exceptions
directory contains your application'south exception handler and is also a good place to identify whatever exceptions thrown by your application. If y'all would similar to customize how your exceptions are logged or rendered, you lot should modify the Handler
class in this directory.
The Http Directory
The Http
directory contains your controllers, middleware, and form requests. About all of the logic to handle requests entering your application will exist placed in this directory.
The Jobs Directory
This directory does not exist by default, but will exist created for you if you execute the make:job
Artisan control. The Jobs
directory houses the queueable jobs for your awarding. Jobs may be queued by your application or run synchronously within the current request lifecycle. Jobs that run synchronously during the current request are sometimes referred to equally "commands" since they are an implementation of the control pattern.
The Listeners Directory
This directory does not exist by default, only will be created for you if you execute the outcome:generate
or brand:listener
Artisan commands. The Listeners
directory contains the classes that handle your events. Outcome listeners receive an event instance and perform logic in response to the result being fired. For example, a UserRegistered
issue might exist handled by a SendWelcomeEmail
listener.
The Mail Directory
This directory does not exist by default, merely volition be created for you lot if you execute the make:mail
Artisan command. The Mail service
directory contains all of your classes that correspond emails sent past your awarding. Mail objects allow you lot to encapsulate all of the logic of building an email in a unmarried, elementary class that may be sent using the Mail::send
method.
The Models Directory
The Models
directory contains all of your Eloquent model classes. The Eloquent ORM included with Laravel provides a beautiful, simple ActiveRecord implementation for working with your database. Each database tabular array has a corresponding "Model" which is used to interact with that tabular array. Models let you to query for data in your tables, as well equally insert new records into the table.
The Notifications Directory
This directory does not exist by default, but will be created for you lot if y'all execute the make:notification
Artisan command. The Notifications
directory contains all of the "transactional" notifications that are sent by your application, such equally simple notifications about events that happen within your application. Laravel's notification characteristic abstracts sending notifications over a variety of drivers such as email, Slack, SMS, or stored in a database.
The Policies Directory
This directory does not exist by default, but will be created for you lot if you lot execute the make:policy
Artisan control. The Policies
directory contains the authorization policy classes for your application. Policies are used to determine if a user tin can perform a given activity against a resources.
The Providers Directory
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 set up your application for incoming requests.
In a fresh Laravel application, this directory will already contain several providers. Y'all are free to add your own providers to this directory as needed.
The Rules Directory
This directory does not exist past default, but will be created for you if you execute the brand:rule
Artisan control. The Rules
directory contains the custom validation rule objects for your application. Rules are used to encapsulate complicated validation logic in a simple object. For more than data, check out the validation documentation.
Source: https://laravel.com/docs/9.x/structure
0 Response to "what is the folder that you need to contain the php files"
Post a Comment