text stringlengths 0 5.25k |
|---|
Laravel Documentation - 11. x https://laravel. com/docs/ e Book compiled from the source https://github. com/laravel/docs/ by david@mundosaparte. com Get the latest version at https://github. com/driade/laravel-book Date: Thursday, 23-May-24 08:34:09 CEST Laravel Documentation - 11. x / Title 2 |
Contents Prologue Release Notes Upgrade Guide Contribution Guide Getting Started Installation Configuration Directory Structure Frontend Starter Kits Deployment Architecture Concepts Request Lifecycle Service Container Service Providers Facades The Basics Routing Middleware CSRF Protection Controllers Requests Response... |
Strings Task Scheduling Security Authentication Authorization Email Verification Encryption Hashing Password Reset Database Getting Started Query Builder Pagination Migrations Seeding Redis Eloquent ORM Getting Started Relationships Collections Mutators / Casts API Resources Serialization Factories Testing Getting Star... |
Scout Socialite Telescope Valet Laravel Documentation - 11. x / Title 5 |
Prologue Release Notes Versioning Scheme Support Policy Laravel 11 Versioning Scheme Laravel and its other first-party packages follow Semantic Versioning. Major framework releases are released every year (~Q1), while minor and patch releases may be released as often as every week. Minor and patch releases should n... |
changes to existing applications. The new application structure is intended to provide a leaner, more modern experience, while retaining many of the concepts that Laravel developers are already familiar with. Below we will discuss the highlights of Laravel's new application structure. The Application Bootstrap File T... |
Scheduling Using a new Schedule facade, scheduled tasks may now be defined directly in your application's routes/console. php file, eliminating the need for a separate console "kernel" class: use Illuminate\Support\Facades\Schedule; Schedule::command('emails:send')->daily(); Exception Handling Like routing and midd... |
Per-Second Rate Limiting Per-second rate limiting was contributed by Tim Mac Donald. Laravel now supports "per-second" rate limiting for all rate limiters, including those for HTTP requests and queued jobs. Previously, Laravel's rate limiters were limited to "per-minute" granularity: Rate Limiter::for('invoices', fun... |
Prompt Validation Prompt validator integration was contributed by Andrea Marco Sartori. Laravel Prompts is a PHP package for adding beautiful and user-friendly forms to your command-line applications, with browser-like features including placeholder text and validation. Laravel Prompts supports input validation via c... |
return [ 'options' => As Collection::using(Option Collection::class), // As Encrypted Collection::using(Option Collection::class), // As Enum Array Object::using(Option Enum::class), // As Enum Collection::using(Option Enum::class), ]; } For more inf... |
Prologue Upgrade Guide Upgrading To 11. 0 From 10. x High Impact Changes Updating Dependencies Application Structure Floating-Point Types Modifying Columns SQLite Minimum Version Updating Sanctum Medium Impact Changes Carbon 3 Password Rehashing Per-Second Rate Limiting Low Impact Changes Doctrine DBAL Removal Eloquent... |
nunomaduro/collision to ^8. 1 laravel/breeze to ^2. 0 (If installed) laravel/cashier to ^15. 0 (If installed) laravel/dusk to ^8. 0 (If installed) laravel/jetstream to ^5. 0 (If installed) laravel/octane to ^2. 3 (If installed) laravel/passport to ^12. 0 (If installed) laravel/sanctum to ^4. 0 (I... |
Likelihood Of Impact: Low The Illuminate\Contracts\Auth\User Provider contract has received a new rehash Password If Required method. This method is responsible for re-hashing and storing the user's password in storage when the application's hashing algorithm work factor has changed. If your application or package ... |
Database SQLite 3. 35. 0+ Likelihood Of Impact: High If your application is utilizing an SQLite database, SQLite 3. 35. 0 or greater is required. Eloquent Model casts Method Likelihood Of Impact: Low The base Eloquent model class now defines a casts method in order to support the definition of attribute casts. If o... |
file before running any pending migrations. Floating-Point Types Likelihood Of Impact: High The double and float migration column types have been rewritten to be consistent across all databases. The double column type now creates a DOUBLE equivalent column without total digits and places (digits after decimal p... |
Therefore, you may remove point, line String, polygon, geometry Collection, multi Point, multi Line String, multi Polygon, and multi Polygon Z methods from your migrations and use geometry or geography methods instead: $table->geometry('shapes'); $table->geography('coordinates'); To explicitly restrict the... |
Database Connection Interface Likelihood Of Impact: Very Low The Illuminate\Database\Connection Interface interface has received a new scalar method. If you are defining your own implementation of this interface, you should add the scalar method to your implementation: public function scalar($query, $bindings = ... |
public function roll Back(); Synchronous Jobs in Database Transactions Likelihood Of Impact: Very Low Previously, synchronous jobs (jobs using the sync queue driver) would execute immediately, regardless of whether the after_commit configuration option of the queue connection was set to true or the after Commit ... |
Likelihood Of Impact: High Laravel 11 no longer supports Laravel Spark Stripe 4. x. Therefore, you should update your application's Laravel Spark Stripe dependency to ^5. 0 in your composer. json file. Spark Stripe 5. 0 no longer automatically loads migrations from its own migrations directory. Instead, you shoul... |
Telescope dependency to ^5. 0 in your composer. json file. Telescope 5. 0 no longer automatically loads migrations from its own migrations directory. Instead, you should run the following command to publish Telescope's migrations to your application: php artisan vendor:publish --tag=telescope-migrations Spatie Onc... |
Prologue Contribution Guide Bug Reports Support Questions Core Development Discussion Which Branch? Compiled Assets Security Vulnerabilities Coding Style PHPDoc Style CI Code of Conduct Bug Reports To encourage active collaboration, Laravel strongly encourages pull requests, not just bug reports. Pull requests will on... |
Laravel Website Support Questions Laravel's Git Hub issue trackers are not intended to provide Laravel help or support. Instead, use one of the following channels: Git Hub Discussions Laracasts Forums Laravel. io Forums Stack Overflow Discord Larachat IRC Core Development Discussion You may propose new features or imp... |
spaces, the argument type, two more spaces, and finally the variable name: /** * Register a binding with the container. * * @param string|array $abstract * @param \Closure|string|null $concrete * @param bool $shared * @return void * * @throws \Exception */ public function bind($abstract, $concrete = null... |
Getting Started Installation Meet Laravel Why Laravel? Creating a Laravel Project Initial Configuration Environment Based Configuration Databases and Migrations Directory Configuration Docker Installation Using Sail Sail on mac OS Sail on Windows Sail on Linux Choosing Your Sail Services IDE Support Next Steps Laravel ... |
Need extreme scaling? Platforms like Laravel Vapor allow you to run your Laravel application at nearly limitless scale on AWS's latest serverless technology. A Community Framework Laravel combines the best packages in the PHP ecosystem to offer the most robust and developer friendly framework available. In addition,... |
configuration documentation. Databases and Migrations Now that you have created your Laravel application, you probably want to store some data in a database. By default, your application's . env configuration file specifies that Laravel will be interacting with a SQLite database. During the creation of the project, L... |
curl -s "https://laravel. build/example-app" | bash Of course, you can change "example-app" in this URL to anything you like - just make sure the application name only contains alpha-numeric characters, dashes, and underscores. The Laravel application's directory will be created within the directory you execute the co... |
Of course, you will need to be able to modify the Laravel application files that were created within your WSL2 installation. To accomplish this, we recommend using Microsoft's Visual Studio Code editor and their first-party extension for Remote Development. Once these tools are installed, you may open any Laravel p... |
In addition, the community maintained Laravel Idea Php Storm plugin offers a variety of helpful IDE augmentations, including code generation, Eloquent syntax completion, validation rule completion, and more. Next Steps Now that you have created your Laravel project, you may be wondering what to learn next. First, we... |
Getting Started Configuration Introduction Environment Configuration Environment Variable Types Retrieving Environment Configuration Determining the Current Environment Encrypting Environment Files Accessing Configuration Values Configuration Caching Configuration Publishing Debug Mode Maintenance Mode Introduction All... |
server-level or system-level environment variables. Environment File Security Your . env file should not be committed to your application's source control, since each developer / server using your application could require a different environment configuration. Furthermore, this would be a security risk in the event ... |
The method will return true if the environment matches any of the given values: if (App::environment('local')) { // The environment is local } if (App::environment(['local', 'staging'])) { // The environment is either local OR staging... } [!NOTE] The current application environment detection can be overridde... |
In order to overwrite an existing environment file, you may provide the --force option to the env:decrypt command: php artisan env:decrypt --force Accessing Configuration Values You may easily access your configuration values using the Config facade or global config function from anywhere in your application. Th... |
Configuration Publishing Most of Laravel's configuration files are already published in your application's config directory; however, certain configuration files like cors. php and view. php are not published by default, as most applications will never need to modify them. However, you may use the config:publish... |
When accessing this hidden route, you will then be redirected to the / route of the application. Once the cookie has been issued to your browser, you will be able to browse the application normally as if it was not in maintenance mode. [!NOTE] Your maintenance mode secret should typically consist of alpha-numeric ch... |
Since maintenance mode requires your application to have several seconds of downtime, consider alternatives like Laravel Vapor and Envoyer to accomplish zero-downtime deployment with Laravel. Laravel Documentation - 11. x / Configuration 37 |
Getting Started Directory Structure Introduction The Root Directory The app Directory The bootstrap Directory The config Directory The database Directory The public Directory The resources Directory The routes Directory The storage Directory The tests Directory The vendor Directory The App Directory... |
The Database Directory The database directory contains your database migrations, model factories, and seeds. If you wish, you may also use this directory to hold an SQLite database. The Public Directory The public directory contains the index. php file, which is the entry point for all requests entering your app... |
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. By default, the app directory contains the Http, Models, and Providers directories. However, over time, a... |
This directory does not exist by default, but will be created for you if you execute the event:generate or make:listener Artisan commands. The Listeners directory contains the classes that handle your events. Event listeners receive an event instance and perform logic in response to the event being fired. For... |
Getting Started Frontend Introduction Using PHP PHP and Blade Livewire Starter Kits Using Vue / React Inertia Starter Kits Bundling Assets Introduction Laravel is a backend framework that provides all of the features you need to build modern web applications, such as routing, validation, caching, queues, file stor... |
allow the construction of modern web application UIs while still primarily utilizing their backend language of choice. For example, in the Rails ecosystem, this has spurred the creation of libraries such as Turbo Hotwire, and Stimulus. Within the Laravel ecosystem, the need to create modern, dynamic frontends by... |
Although it's possible to build modern frontends using Laravel and Livewire, many developers still prefer to leverage the power of a Java Script framework like Vue or React. This allows developers to take advantage of the rich ecosystem of Java Script packages and tools available via NPM. However, without additional t... |
</Layout> </template> As you can see, Inertia allows you to leverage the full power of Vue or React when building your frontend, while providing a light-weight bridge between your Laravel powered backend and your Java Script powered frontend. Server-Side Rendering If you're concerned about diving into Inertia becau... |
Getting Started Starter Kits Introduction Laravel Breeze Installation Breeze and Blade Breeze and Livewire Breeze and React / Vue Breeze and Next. js / API Laravel Jetstream Introduction To give you a head start building your new Laravel application, we are happy to offer authentication and application starter kits. T... |
Laravel Bootcamp If you're new to Laravel, feel free to jump into the Laravel Bootcamp. The Laravel Bootcamp will walk you through building your first Laravel application using Breeze. It's a great way to get a tour of everything that Laravel and Breeze have to offer. Installation First, you should create a new Lar... |
Breeze and Blade The default Breeze "stack" is the Blade stack, which utilizes simple Blade templates to render your application's frontend. The Blade stack may be installed by invoking the breeze:install command with no other additional arguments and selecting the Blade frontend stack. After Breeze's scaffolding... |
php artisan migrate During installation, Breeze will add a FRONTEND_URL environment variable to your application's . env file. This URL should be the URL of your Java Script application. This will typically be http://localhost:3000 during local development. In addition, you should ensure that your APP_URL is ... |
Getting Started Deployment Introduction Server Requirements Server Configuration Nginx Franken PHP Optimization Caching Configuration Caching Events Caching Routes Caching Views Debug Mode The Health Route Easy Deployment With Forge / Vapor Introduction When you're ready to deploy your Laravel application to production... |
listen 80; listen [::]:80; server_name example. com; root /srv/example. com/public; add_header X-Frame-Options "SAMEORIGIN"; add_header X-Content-Type-Options "nosniff"; index index. php; charset utf-8; location / { try_files $uri $uri/ /index. php?$query_string; } lo... |
the number of trips the framework must make to the filesystem when loading your configuration values. [!WARNING] If you execute the config:cache command during your deployment process, you should be sure that you are only calling the env function from within your configuration files. Once the configuration has bee... |
Illuminate\Foundation\Events\Diagnosing Health event, allowing you to perform additional health checks relevant to your application. Within a listener for this event, you may check your application's database or cache status. If you detect a problem with your application, you may simply throw an exception from the... |
Architecture Concepts Request Lifecycle Introduction Lifecycle Overview First Steps HTTP / Console Kernels Service Providers Routing Finishing Up Focus on Service Providers Introduction When using any tool in the "real world", you feel more confident if you understand how that tool works. Application development is no ... |
One of the most important kernel bootstrapping actions is loading the service providers for your application. Service providers are responsible for bootstrapping all of the framework's various components, such as the database, queue, validation, and routing components. Laravel will iterate through this list of provid... |
Architecture Concepts Service Container Introduction Zero Configuration Resolution When to Utilize the Container Binding Binding Basics Binding Interfaces to Implementations Contextual Binding Binding Primitives Binding Typed Variadics Tagging Extending Bindings Resolving The Make Method Automatic Injection Method Invo... |
well as for contributing to the Laravel core itself. Zero Configuration Resolution If a class has no dependencies or only depends on other concrete classes (not interfaces), the container does not need to be instructed on how to resolve that class. For example, you may place the following code in your routes/web. php... |
use App\Services\Transistor; use App\Services\Podcast Parser; use Illuminate\Contracts\Foundation\Application; $this->app->bind(Transistor::class, function (Application $app) { return new Transistor($app->make(Podcast Parser::class)); }); Note that we receive the container itself as an argument to the resolver. We... |
You may also bind an existing object instance into the container using the instance method. The given instance will always be returned on subsequent calls into the container: use App\Services\Transistor; use App\Services\Podcast Parser; $service = new Transistor(new Podcast Parser); $this->app->instance(Transistor::... |
->give($value); Sometimes a class may depend on an array of tagged instances. Using the give Tagged method, you may easily inject all of the container bindings with that tag: $this->app->when(Report Aggregator::class) ->needs('$reports') ->give Tagged('reports'); If you need to inject a value fro... |
Using the needs and give Tagged methods, you may easily inject all of the container bindings with that tag for the given dependency: $this->app->when(Report Aggregator::class) ->needs(Report::class) ->give Tagged('reports'); Tagging Occasionally, you may need to resolve all of a certain "category" of bind... |
use App\Services\Transistor; use Illuminate\Support\Facades\App; $transistor = App::make(Transistor::class); $transistor = app(Transistor::class); If you would like to have the Laravel container instance itself injected into a class that is being resolved by the container, you may type-hint the Illuminate\Container\Co... |
{ return [ // ... ]; } } You may invoke the generate method via the container like so: use App\User Report; use Illuminate\Support\Facades\App; $report = App::call([new User Report, 'generate']); The call method accepts any PHP callable. The container's call method may even be... |
Architecture Concepts Service Providers Introduction Writing Service Providers The Register Method The Boot Method Registering Providers Deferred Providers Introduction Service providers are the central place of all Laravel application bootstrapping. Your own application, as well as all of Laravel's core services, are... |
class Riak Service Provider extends Service Provider { /** * Register any application services. */ public function register(): void { $this->app->singleton(Connection::class, function (Application $app) { return new Connection(config('riak')); }); } } This service p... |
*/ public function boot(): void { View::composer('view', function () { // ... }); } } Boot Method Dependency Injection You may type-hint dependencies for your service provider's boot method. The service container will automatically inject any dependencies you need: use ... |
use App\Services\Riak\Connection; use Illuminate\Contracts\Foundation\Application; use Illuminate\Contracts\Support\Deferrable Provider; use Illuminate\Support\Service Provider; class Riak Service Provider extends Service Provider implements Deferrable Provider { /** * Register any application services. *... |
Architecture Concepts Facades Introduction When to Utilize Facades Facades vs. Dependency Injection Facades vs. Helper Functions How Facades Work Real-Time Facades Facade Class Reference Introduction Throughout the Laravel documentation, you will see examples of code that interacts with Laravel's features via "facade... |
without remembering long class names that must be injected or configured manually. Furthermore, because of their unique usage of PHP's dynamic methods, they are easy to test. However, some care must be taken when using facades. The primary danger of facades is class "scope creep". Since facades are so easy to use and... |
you may still test them exactly as you would the corresponding facade. For example, given the following route: Route::get('/cache', function () { return cache('key'); }); The cache helper is going to call the get method on the class underlying the Cache facade. So, even though we are using the helper functi... |
Instead, the Cache facade extends the base Facade class and defines the method get Facade Accessor(). This method's job is to return the name of a service container binding. When a user references any static method on the Cache facade, Laravel resolves the cache binding from the service container and runs ... |
test('podcast can be published', function () { $podcast = Podcast::factory()->create(); Publisher::should Receive('publish')->once()->with($podcast); $podcast->publish(); }); <?php namespace Tests\Feature; use App\Models\Podcast; use Facades\App\Contracts\Publisher; use Illuminate\Foundation\Testing\Refresh... |
(https://laravel. com/api/{{version}}/Illuminate/Events/Dispatcher. html) | `events` Exceptions | [Illuminate\Foundation\Exceptions\Handler] (https://laravel. com/api/{{version}}/Illuminate/Foundation/Exceptions/Handler. html) | Exceptions (Instance) | [Illuminate\Contracts\Debug\Exception Handler] (https://lar... |
The Basics Routing Basic Routing The Default Route Files Redirect Routes View Routes Listing Your Routes Routing Customization Route Parameters Required Parameters Optional Parameters Regular Expression Constraints Named Routes Route Groups Middleware Controllers Subdomain Routing Route Prefixes Route Name Prefixes Rou... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 4