diff --git a/requests.md b/requests.md index 97c77b2e10a..27d70db6710 100644 --- a/requests.md +++ b/requests.md @@ -276,7 +276,7 @@ Route::get('/', function (ServerRequestInterface $request) { }); ``` -> [!NOTE] +> [!NOTE] > If you return a PSR-7 response instance from a route or controller, it will automatically be converted back to a Laravel response instance and be displayed by the framework. @@ -456,7 +456,7 @@ $input = $request->except(['credit_card']); $input = $request->except('credit_card'); ``` -> [!WARNING] +> [!WARNING] > The `only` method returns all of the key / value pairs that you request; however, it will not return key / value pairs that are not present on the request. @@ -754,7 +754,7 @@ $path = $request->photo->storeAs('images', 'filename.jpg'); $path = $request->photo->storeAs('images', 'filename.jpg', 's3'); ``` -> [!NOTE] +> [!NOTE] > For more information about file storage in Laravel, check out the complete [file storage documentation](/docs/{{version}}/filesystem). @@ -786,7 +786,7 @@ In addition to configuring the trusted proxies, you may also configure the proxy }) ``` -> [!NOTE] +> [!NOTE] > If you are using AWS Elastic Load Balancing, the `headers` value should be `Request::HEADER_X_FORWARDED_AWS_ELB`. If your load balancer uses the standard `Forwarded` header from [RFC 7239](https://www.rfc-editor.org/rfc/rfc7239#section-4), the `headers` value should be `Request::HEADER_FORWARDED`. For more information on the constants that may be used in the `headers` value, check out Symfony's documentation on [trusting proxies](https://symfony.com/doc/7.0/deployment/proxies.html). diff --git a/responses.md b/responses.md index a4201290946..fbf1516f9de 100644 --- a/responses.md +++ b/responses.md @@ -39,7 +39,7 @@ Route::get('/', function () { }); ``` -> [!NOTE] +> [!NOTE] > Did you know you can also return [Eloquent collections](/docs/{{version}}/eloquent-collections) from your routes or controllers? They will automatically be converted to JSON. Give it a shot! @@ -345,7 +345,7 @@ return response()->download($pathToFile); return response()->download($pathToFile, $name, $headers); ``` -> [!WARNING] +> [!WARNING] > Symfony HttpFoundation, which manages file downloads, requires the file being downloaded to have an ASCII filename. diff --git a/reverb.md b/reverb.md index 7c9a6788a80..7682656d01f 100644 --- a/reverb.md +++ b/reverb.md @@ -197,7 +197,7 @@ Connection activity is recorded by polling for new updates on a periodic basis. Due to the long-running nature of WebSocket servers, you may need to make some optimizations to your server and hosting environment to ensure your Reverb server can effectively handle the optimal number of connections for the resources available on your server. -> [!NOTE] +> [!NOTE] > If your site is managed by [Laravel Forge](https://forge.laravel.com), you may automatically optimize your server for Reverb directly from the "Application" panel. By enabling the Reverb integration, Forge will ensure your server is production-ready, including installing any required extensions and increasing the allowed number of connections. @@ -259,7 +259,7 @@ server { } ``` -> [!WARNING] +> [!WARNING] > Reverb listens for WebSocket connections at `/app` and handles API requests at `/apps`. You should ensure the web server handling Reverb requests can serve both of these URIs. If you are using [Laravel Forge](https://forge.laravel.com) to manage your servers, your Reverb server will be correctly configured by default. Typically, web servers are configured to limit the number of allowed connections in order to prevent overloading the server. To increase the number of allowed connections on an Nginx web server to 10,000, the `worker_rlimit_nofile` and `worker_connections` values of the `nginx.conf` file should be updated: diff --git a/routing.md b/routing.md index c37c2b11f66..a0273378b32 100644 --- a/routing.md +++ b/routing.md @@ -109,7 +109,7 @@ Route::any('/', function () { }); ``` -> [!NOTE] +> [!NOTE] > When defining multiple routes that share the same URI, routes using the `get`, `post`, `put`, `patch`, `delete`, and `options` methods should be defined before routes using the `any`, `match`, and `redirect` methods. This ensures the incoming request is matched with the correct route. @@ -158,7 +158,7 @@ Or, you may use the `Route::permanentRedirect` method to return a `301` status c Route::permanentRedirect('/here', '/there'); ``` -> [!WARNING] +> [!WARNING] > When using route parameters in redirect routes, the following parameters are reserved by Laravel and cannot be used: `destination` and `status`. @@ -172,7 +172,7 @@ Route::view('/welcome', 'welcome'); Route::view('/welcome', 'welcome', ['name' => 'Taylor']); ``` -> [!WARNING] +> [!WARNING] > When using route parameters in view routes, the following parameters are reserved by Laravel and cannot be used: `view`, `data`, `status`, and `headers`. @@ -402,7 +402,7 @@ Route::get('/search/{search}', function (string $search) { })->where('search', '.*'); ``` -> [!WARNING] +> [!WARNING] > Encoded forward slashes are only supported within the last route segment. @@ -425,7 +425,7 @@ Route::get( )->name('profile'); ``` -> [!WARNING] +> [!WARNING] > Route names should always be unique. @@ -465,7 +465,7 @@ $url = route('profile', ['id' => 1, 'photos' => 'yes']); // /user/1/profile?photos=yes ``` -> [!NOTE] +> [!NOTE] > Sometimes, you may wish to specify request-wide default values for URL parameters, such as the current locale. To accomplish this, you may use the [`URL::defaults` method](/docs/{{version}}/urls#default-values). @@ -544,7 +544,7 @@ Route::domain('{account}.example.com')->group(function () { }); ``` -> [!WARNING] +> [!WARNING] > In order to ensure your subdomain routes are reachable, you should register subdomain routes before registering root domain routes. This will prevent root domain routes from overwriting subdomain routes which have the same URI path. @@ -1023,7 +1023,7 @@ php artisan config:publish cors This command will place a `cors.php` configuration file within your application's `config` directory. -> [!NOTE] +> [!NOTE] > For more information on CORS and CORS headers, please consult the [MDN web documentation on CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#The_HTTP_response_headers). diff --git a/sail.md b/sail.md index 239c99e6e02..a7b90572d2b 100644 --- a/sail.md +++ b/sail.md @@ -66,7 +66,7 @@ Finally, you may start Sail. To continue learning how to use Sail, please contin ./vendor/bin/sail up ``` -> [!WARNING] +> [!WARNING] > If you are using Docker Desktop for Linux, you should use the `default` Docker context by executing the following command: `docker context use default`. @@ -300,7 +300,7 @@ AWS_URL=http://localhost:9000/local You may create buckets via the MinIO console, which is available at `http://localhost:8900`. The default username for the MinIO console is `sail` while the default password is `password`. -> [!WARNING] +> [!WARNING] > Generating temporary storage URLs via the `temporaryUrl` method is not supported when using MinIO. @@ -480,7 +480,7 @@ If you would like to choose the subdomain for your shared site, you may provide sail share --subdomain=my-sail-site ``` -> [!NOTE] +> [!NOTE] > The `share` command is powered by [Expose](https://github.com/beyondcode/expose), an open source tunneling service by [BeyondCode](https://beyondco.de). @@ -551,7 +551,7 @@ To debug your application while interacting with the application via a web brows If you're using PhpStorm, please review JetBrains' documentation regarding [zero-configuration debugging](https://www.jetbrains.com/help/phpstorm/zero-configuration-debugging.html). -> [!WARNING] +> [!WARNING] > Laravel Sail relies on `artisan serve` to serve your application. The `artisan serve` command only accepts the `XDEBUG_CONFIG` and `XDEBUG_MODE` variables as of Laravel version 8.53.0. Older versions of Laravel (8.52.0 and below) do not support these variables and will not accept debug connections. diff --git a/sanctum.md b/sanctum.md index 3a3fe9f4a99..5dfddf7038a 100644 --- a/sanctum.md +++ b/sanctum.md @@ -48,7 +48,7 @@ For this feature, Sanctum does not use tokens of any kind. Instead, Sanctum uses Sanctum will only attempt to authenticate using cookies when the incoming request originates from your own SPA frontend. When Sanctum examines an incoming HTTP request, it will first check for an authentication cookie and, if none is present, Sanctum will then examine the `Authorization` header for a valid API token. -> [!NOTE] +> [!NOTE] > It is perfectly fine to use Sanctum only for API token authentication or only for SPA authentication. Just because you use Sanctum does not mean you are required to use both features it offers. @@ -97,7 +97,7 @@ public function boot(): void ## API Token Authentication -> [!NOTE] +> [!NOTE] > You should not use API tokens to authenticate your own first-party SPA. Instead, use Sanctum's built-in [SPA authentication features](#spa-authentication). @@ -269,7 +269,7 @@ Sanctum also exists to provide a simple method of authenticating single page app For this feature, Sanctum does not use tokens of any kind. Instead, Sanctum uses Laravel's built-in cookie based session authentication services. This approach to authentication provides the benefits of CSRF protection, session authentication, as well as protects against leakage of the authentication credentials via XSS. -> [!WARNING] +> [!WARNING] > In order to authenticate, your SPA and API must share the same top-level domain. However, they may be placed on different subdomains. Additionally, you should ensure that you send the `Accept: application/json` header and either the `Referer` or `Origin` header with your request. @@ -280,7 +280,7 @@ For this feature, Sanctum does not use tokens of any kind. Instead, Sanctum uses First, you should configure which domains your SPA will be making requests from. You may configure these domains using the `stateful` configuration option in your `sanctum` configuration file. This configuration setting determines which domains will maintain "stateful" authentication using Laravel session cookies when making requests to your API. -> [!WARNING] +> [!WARNING] > If you are accessing your application via a URL that includes a port (`127.0.0.1:8000`), you should ensure that you include the port number with the domain. @@ -345,7 +345,7 @@ If the login request is successful, you will be authenticated and subsequent req Of course, if your user's session expires due to lack of activity, subsequent requests to the Laravel application may receive a 401 or 419 HTTP error response. In this case, you should redirect the user to your SPA's login page. -> [!WARNING] +> [!WARNING] > You are free to write your own `/login` endpoint; however, you should ensure that it authenticates the user using the standard, [session based authentication services that Laravel provides](/docs/{{version}}/authentication#authenticating-users). Typically, this means using the `web` authentication guard. @@ -444,7 +444,7 @@ Route::post('/sanctum/token', function (Request $request) { When the mobile application uses the token to make an API request to your application, it should pass the token in the `Authorization` header as a `Bearer` token. -> [!NOTE] +> [!NOTE] > When issuing tokens for a mobile application, you are also free to specify [token abilities](#token-abilities). diff --git a/scheduling.md b/scheduling.md index 9e038dbd250..a335055b62b 100644 --- a/scheduling.md +++ b/scheduling.md @@ -319,7 +319,7 @@ If you are repeatedly assigning the same timezone to all of your scheduled tasks 'schedule_timezone' => 'America/Chicago', ``` -> [!WARNING] +> [!WARNING] > Remember that some timezones utilize daylight savings time. When daylight saving time changes occur, your scheduled task may run twice or even not run at all. For this reason, we recommend avoiding timezone scheduling when possible. @@ -346,7 +346,7 @@ Behind the scenes, the `withoutOverlapping` method utilizes your application's [ ### Running Tasks on One Server -> [!WARNING] +> [!WARNING] > To utilize this feature, your application must be using the `database`, `memcached`, `dynamodb`, or `redis` cache driver as your application's default cache driver. In addition, all servers must be communicating with the same central cache server. If your application's scheduler is running on multiple servers, you may limit a scheduled job to only execute on a single server. For instance, assume you have a scheduled task that generates a new report every Friday night. If the task scheduler is running on three worker servers, the scheduled task will run on all three servers and generate the report three times. Not good! @@ -401,7 +401,7 @@ Schedule::command('analytics:report') ->runInBackground(); ``` -> [!WARNING] +> [!WARNING] > The `runInBackground` method may only be used when scheduling tasks via the `command` and `exec` methods. @@ -526,7 +526,7 @@ Schedule::command('report:generate') ->emailOutputOnFailure('taylor@example.com'); ``` -> [!WARNING] +> [!WARNING] > The `emailOutputTo`, `emailOutputOnFailure`, `sendOutputTo`, and `appendOutputTo` methods are exclusive to the `command` and `exec` methods. @@ -602,7 +602,7 @@ The `pingBeforeIf`,`thenPingIf`,`pingOnSuccessIf`, and `pingOnFailureIf` methods Schedule::command('emails:send') ->daily() ->pingBeforeIf($condition, $url) - ->thenPingIf($condition, $url); + ->thenPingIf($condition, $url); Schedule::command('emails:send') ->daily() diff --git a/seeding.md b/seeding.md index 28f6970af67..3ae64998d49 100644 --- a/seeding.md +++ b/seeding.md @@ -12,7 +12,7 @@ Laravel includes the ability to seed your database with data using seed classes. All seed classes are stored in the `database/seeders` directory. By default, a `DatabaseSeeder` class is defined for you. From this class, you may use the `call` method to run other seed classes, allowing you to control the seeding order. -> [!NOTE] +> [!NOTE] > [Mass assignment protection](/docs/{{version}}/eloquent#mass-assignment) is automatically disabled during database seeding. @@ -54,7 +54,7 @@ class DatabaseSeeder extends Seeder } ``` -> [!NOTE] +> [!NOTE] > You may type-hint any dependencies you need within the `run` method's signature. They will automatically be resolved via the Laravel [service container](/docs/{{version}}/container). diff --git a/session.md b/session.md index 543cac5a0a6..7aa5462507d 100644 --- a/session.md +++ b/session.md @@ -39,7 +39,7 @@ The session `driver` configuration option defines where session data will be sto -> [!NOTE] +> [!NOTE] > The array driver is primarily used during [testing](/docs/{{version}}/testing) and prevents the data stored in the session from being persisted. @@ -61,7 +61,7 @@ php artisan migrate Before using Redis sessions with Laravel, you will need to either install the PhpRedis PHP extension via PECL or install the `predis/predis` package (~1.0) via Composer. For more information on configuring Redis, consult Laravel's [Redis documentation](/docs/{{version}}/redis#configuration). -> [!NOTE] +> [!NOTE] > The `SESSION_CONNECTION` environment variable, or the `connection` option in the `session.php` configuration file, may be used to specify which Redis connection is used for session storage. @@ -126,7 +126,7 @@ Route::get('/home', function () { }); ``` -> [!NOTE] +> [!NOTE] > There is little practical difference between using the session via an HTTP request instance versus using the global `session` helper. Both methods are [testable](/docs/{{version}}/testing) via the `assertSessionHas` method which is available in all of your test cases. @@ -280,7 +280,7 @@ $request->session()->invalidate(); ## Session Blocking -> [!WARNING] +> [!WARNING] > To utilize session blocking, your application must be using a cache driver that supports [atomic locks](/docs/{{version}}/cache#atomic-locks). Currently, those cache drivers include the `memcached`, `dynamodb`, `redis`, `mongodb` (included in the official `mongodb/laravel-mongodb` package), `database`, `file`, and `array` drivers. In addition, you may not use the `cookie` session driver. By default, Laravel allows requests using the same session to execute concurrently. So, for example, if you use a JavaScript HTTP library to make two HTTP requests to your application, they will both execute at the same time. For many applications, this is not a problem; however, session data loss can occur in a small subset of applications that make concurrent requests to two different application endpoints which both write data to the session. diff --git a/socialite.md b/socialite.md index c417c9a8974..879ac7605d6 100644 --- a/socialite.md +++ b/socialite.md @@ -17,7 +17,7 @@ In addition to typical, form based authentication, Laravel also provides a simple, convenient way to authenticate with OAuth providers using [Laravel Socialite](https://github.com/laravel/socialite). Socialite currently supports authentication via Facebook, X, LinkedIn, Google, GitHub, GitLab, Bitbucket, and Slack. -> [!NOTE] +> [!NOTE] > Adapters for other platforms are available via the community driven [Socialite Providers](https://socialiteproviders.com/) website. @@ -49,7 +49,7 @@ These credentials should be placed in your application's `config/services.php` c ], ``` -> [!NOTE] +> [!NOTE] > If the `redirect` option contains a relative path, it will automatically be resolved to a fully qualified URL. @@ -104,7 +104,7 @@ Route::get('/auth/callback', function () { }); ``` -> [!NOTE] +> [!NOTE] > For more information regarding what user information is available from specific OAuth providers, please consult the documentation on [retrieving user details](#retrieving-user-details). @@ -172,7 +172,7 @@ return Socialite::driver('google') ->redirect(); ``` -> [!WARNING] +> [!WARNING] > When using the `with` method, be careful not to pass any reserved keywords such as `state` or `response_type`. diff --git a/starter-kits.md b/starter-kits.md index 5f00183204f..a65cb29cb22 100644 --- a/starter-kits.md +++ b/starter-kits.md @@ -386,4 +386,3 @@ php artisan vendor:publish --tag=laravel-mail ``` This will generate several files in `resources/views/vendor/mail`. You can modify any of these files as well as the `resources/views/vendor/mail/themes/default.css` file to change the look and appearance of the default email template. - diff --git a/structure.md b/structure.md index e1b62d043f0..452d16bbdfd 100644 --- a/structure.md +++ b/structure.md @@ -106,7 +106,7 @@ By default, the `app` directory contains the `Http`, `Models`, and `Providers` d Both the `Console` and `Http` directories are further explained in their respective sections below, but think of the `Console` and `Http` directories as providing an API into the core of your application. The HTTP protocol and CLI are both mechanisms to interact with your application, but do not actually contain application logic. In other words, they are two ways 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. -> [!NOTE] +> [!NOTE] > Many of the classes in the `app` directory can be generated by Artisan via commands. To review the available commands, run the `php artisan list make` command in your terminal. diff --git a/telescope.md b/telescope.md index 7b82058b64d..de9d418ca42 100644 --- a/telescope.md +++ b/telescope.md @@ -151,7 +151,7 @@ protected function gate(): void } ``` -> [!WARNING] +> [!WARNING] > You should ensure you change your `APP_ENV` environment variable to `production` in your production environment. Otherwise, your Telescope installation will be publicly available. diff --git a/testing.md b/testing.md index 740b1c01b86..8532d5235ba 100644 --- a/testing.md +++ b/testing.md @@ -46,7 +46,7 @@ If you would like to create a test within the `tests/Unit` directory, you may us php artisan make:test UserTest --unit ``` -> [!NOTE] +> [!NOTE] > Test stubs may be customized using [stub publishing](/docs/{{version}}/artisan#stub-customization). Once the test has been generated, you may define test as you normally would using Pest or PHPUnit. To run your tests, execute the `vendor/bin/pest`, `vendor/bin/phpunit`, or `php artisan test` command from your terminal: @@ -78,7 +78,7 @@ class ExampleTest extends TestCase } ``` -> [!WARNING] +> [!WARNING] > If you define your own `setUp` / `tearDown` methods within a test class, be sure to call the respective `parent::setUp()` / `parent::tearDown()` methods on the parent class. Typically, you should invoke `parent::setUp()` at the start of your own `setUp` method, and `parent::tearDown()` at the end of your `tearDown` method. @@ -123,7 +123,7 @@ By default, Laravel will create as many processes as there are available CPU cor php artisan test --parallel --processes=4 ``` -> [!WARNING] +> [!WARNING] > When running tests in parallel, some Pest / PHPUnit options (such as `--do-not-cache-result`) may not be available. @@ -195,7 +195,7 @@ If you would like to access the current parallel process "token" from any other ### Reporting Test Coverage -> [!WARNING] +> [!WARNING] > This feature requires [Xdebug](https://xdebug.org) or [PCOV](https://pecl.php.net/package/pcov). When running your application tests, you may want to determine whether your test cases are actually covering the application code and how much application code is used when running your tests. To accomplish this, you may provide the `--coverage` option when invoking the `test` command: diff --git a/valet.md b/valet.md index 75e9704b05b..45839e43dd1 100644 --- a/valet.md +++ b/valet.md @@ -22,7 +22,7 @@ ## Introduction -> [!NOTE] +> [!NOTE] > Looking for an even easier way to develop Laravel applications on macOS or Windows? Check out [Laravel Herd](https://herd.laravel.com). Herd includes everything you need to get started with Laravel development, including Valet, PHP, and Composer. [Laravel Valet](https://github.com/laravel/valet) is a development environment for macOS minimalists. Laravel Valet configures your Mac to always run [Nginx](https://www.nginx.com/) in the background when your machine starts. Then, using [DnsMasq](https://en.wikipedia.org/wiki/Dnsmasq), Valet proxies all requests on the `*.test` domain to point to sites installed on your local machine. @@ -69,7 +69,7 @@ However, you may extend Valet with your own [custom drivers](#custom-valet-drive ## Installation -> [!WARNING] +> [!WARNING] > Valet requires macOS and [Homebrew](https://brew.sh/). Before installation, you should make sure that no other programs such as Apache or Nginx are binding to your local machine's port 80. To get started, you first need to ensure that Homebrew is up to date using the `update` command: @@ -103,7 +103,7 @@ Valet will automatically start its required services each time your machine boot #### PHP Versions -> [!NOTE] +> [!NOTE] > Instead of modifying your global PHP version, you can instruct Valet to use per-site PHP versions via the `isolate` [command](#per-site-php-versions). Valet allows you to switch PHP versions using the `valet use php@version` command. Valet will install the specified PHP version via Homebrew if it is not already installed: @@ -122,7 +122,7 @@ php=php@8.2 Once this file has been created, you may simply execute the `valet use` command and the command will determine the site's preferred PHP version by reading the file. -> [!WARNING] +> [!WARNING] > Valet only serves one PHP version at a time, even if you have multiple PHP versions installed. @@ -294,7 +294,7 @@ valet share To stop sharing your site, you may press `Control + C`. -> [!WARNING] +> [!WARNING] > If you're using a custom DNS server (like `1.1.1.1`), ngrok sharing may not work correctly. If this is the case on your machine, open your Mac's system settings, go to the Network settings, open the Advanced settings, then go the DNS tab and add `127.0.0.1` as your first DNS server. @@ -306,7 +306,7 @@ Sharing your site using ngrok requires you to [create an ngrok account](https:// valet set-ngrok-token YOUR_TOKEN_HERE ``` -> [!NOTE] +> [!NOTE] > You may pass additional ngrok parameters to the share command, such as `valet share --region=eu`. For more information, consult the [ngrok documentation](https://ngrok.com/docs). @@ -424,7 +424,7 @@ public function isStaticFile(string $sitePath, string $siteName, string $uri) } ``` -> [!WARNING] +> [!WARNING] > The `isStaticFile` method will only be called if the `serves` method returns `true` for the incoming request and the request URI is not `/`. diff --git a/validation.md b/validation.md index 3d2214841f7..781d62338b2 100644 --- a/validation.md +++ b/validation.md @@ -218,7 +218,7 @@ Within the `lang/en/validation.php` file, you will find a translation entry for In addition, you may copy this file to another language directory to translate the messages for your application's language. To learn more about Laravel localization, check out the complete [localization documentation](/docs/{{version}}/localization). -> [!WARNING] +> [!WARNING] > By default, the Laravel application skeleton does not include the `lang` directory. If you would like to customize Laravel's language files, you may publish them via the `lang:publish` Artisan command. @@ -345,7 +345,7 @@ public function rules(): array } ``` -> [!NOTE] +> [!NOTE] > You may type-hint any dependencies you require within the `rules` method's signature. They will automatically be resolved via the Laravel [service container](/docs/{{version}}/container). So, how are the validation rules evaluated? All you need to do is type-hint the request on your controller method. The incoming form request is validated before the controller method is called, meaning you do not need to clutter your controller with any validation logic: @@ -373,7 +373,7 @@ public function store(StorePostRequest $request): RedirectResponse If validation fails, a redirect response will be generated to send the user back to their previous location. The errors will also be flashed to the session so they are available for display. If the request was an XHR request, an HTTP response with a 422 status code will be returned to the user including a [JSON representation of the validation errors](#validation-error-response-format). -> [!NOTE] +> [!NOTE] > Need to add real-time form request validation to your Inertia powered Laravel frontend? Check out [Laravel Precognition](/docs/{{version}}/precognition). @@ -510,7 +510,7 @@ public function authorize(): bool } ``` -> [!NOTE] +> [!NOTE] > You may type-hint any dependencies you need within the `authorize` method's signature. They will automatically be resolved via the Laravel [service container](/docs/{{version}}/container). @@ -874,7 +874,7 @@ Within the `lang/en/validation.php` file, you will find a translation entry for In addition, you may copy this file to another language directory to translate the messages for your application's language. To learn more about Laravel localization, check out the complete [localization documentation](/docs/{{version}}/localization). -> [!WARNING] +> [!WARNING] > By default, the Laravel application skeleton does not include the `lang` directory. If you would like to customize Laravel's language files, you may publish them via the `lang:publish` Artisan command. @@ -902,7 +902,7 @@ Many of Laravel's built-in error messages include an `:attribute` placeholder th ], ``` -> [!WARNING] +> [!WARNING] > By default, the Laravel application skeleton does not include the `lang` directory. If you would like to customize Laravel's language files, you may publish them via the `lang:publish` Artisan command. @@ -932,7 +932,7 @@ Instead of displaying `cc` as the payment type value, you may specify a more use ], ``` -> [!WARNING] +> [!WARNING] > By default, the Laravel application skeleton does not include the `lang` directory. If you would like to customize Laravel's language files, you may publish them via the `lang:publish` Artisan command. After defining this value, the validation rule will produce the following error message: @@ -1513,7 +1513,7 @@ $request->validate([ ]); ``` -> [!WARNING] +> [!WARNING] > The `dns` and `spoof` validators require the PHP `intl` extension. @@ -1666,7 +1666,7 @@ The file under validation must have a user-assigned extension corresponding to o 'photo' => ['required', 'extensions:jpg,png'], ``` -> [!WARNING] +> [!WARNING] > You should never rely on validating a file by its user-assigned extension alone. This rule should typically always be used in combination with the [`mimes`](#rule-mimes) or [`mimetypes`](#rule-mimetypes) rules. @@ -1748,7 +1748,7 @@ The field under validation must exist in _anotherfield_'s values. The field under validation must be an integer. -> [!WARNING] +> [!WARNING] > This validation rule does not verify that the input is of the "integer" variable type, only that the input is of a type accepted by PHP's `FILTER_VALIDATE_INT` rule. If you need to validate the input as being a number please use this rule in combination with [the `numeric` validation rule](#rule-numeric). @@ -1898,7 +1898,7 @@ The field under validation must not match the given regular expression. Internally, this rule uses the PHP `preg_match` function. The pattern specified should obey the same formatting required by `preg_match` and thus also include valid delimiters. For example: `'email' => 'not_regex:/^.+$/i'`. -> [!WARNING] +> [!WARNING] > When using the `regex` / `not_regex` patterns, it may be necessary to specify your validation rules using an array instead of using `|` delimiters, especially if the regular expression contains a `|` character. @@ -2014,7 +2014,7 @@ The field under validation must match the given regular expression. Internally, this rule uses the PHP `preg_match` function. The pattern specified should obey the same formatting required by `preg_match` and thus also include valid delimiters. For example: `'email' => 'regex:/^.+@.+$/i'`. -> [!WARNING] +> [!WARNING] > When using the `regex` / `not_regex` patterns, it may be necessary to specify rules in an array instead of using `|` delimiters, especially if the regular expression contains a `|` character. @@ -2185,7 +2185,7 @@ Validator::make($data, [ ]); ``` -> [!WARNING] +> [!WARNING] > You should never pass any user controlled request input into the `ignore` method. Instead, you should only pass a system generated unique ID such as an auto-incrementing ID or UUID from an Eloquent model instance. Otherwise, your application will be vulnerable to an SQL injection attack. Instead of passing the model key's value to the `ignore` method, you may also pass the entire model instance. Laravel will automatically extract the key from the model: @@ -2303,7 +2303,7 @@ $validator = Validator::make($data, [ In the example above, the `email` field will only be validated if it is present in the `$data` array. -> [!NOTE] +> [!NOTE] > If you are attempting to validate a field that should always be present but may be empty, check out [this note on optional fields](#a-note-on-optional-fields). @@ -2338,7 +2338,7 @@ $validator->sometimes(['reason', 'cost'], 'required', function (Fluent $input) { }); ``` -> [!NOTE] +> [!NOTE] > The `$input` parameter passed to your closure will be an instance of `Illuminate\Support\Fluent` and may be used to access your input and files under validation. @@ -2845,5 +2845,5 @@ For a custom rule to run even when an attribute is empty, the rule must imply th php artisan make:rule Uppercase --implicit ``` -> [!WARNING] +> [!WARNING] > An "implicit" rule only _implies_ that the attribute is required. Whether it actually invalidates a missing or empty attribute is up to you. diff --git a/verification.md b/verification.md index c959d72835e..b8d05eebbdc 100644 --- a/verification.md +++ b/verification.md @@ -16,7 +16,7 @@ Many web applications require users to verify their email addresses before using the application. Rather than forcing you to re-implement this feature by hand for each application you create, Laravel provides convenient built-in services for sending and verifying email verification requests. -> [!NOTE] +> [!NOTE] > Want to get started fast? Install one of the [Laravel application starter kits](/docs/{{version}}/starter-kits) in a fresh Laravel application. The starter kits will take care of scaffolding your entire authentication system, including email verification support. @@ -78,7 +78,7 @@ Route::get('/email/verify', function () { The route that returns the email verification notice should be named `verification.notice`. It is important that the route is assigned this exact name since the `verified` middleware [included with Laravel](#protecting-routes) will automatically redirect to this route name if a user has not verified their email address. -> [!NOTE] +> [!NOTE] > When manually implementing email verification, you are required to define the contents of the verification notice view yourself. If you would like scaffolding that includes all necessary authentication and verification views, check out the [Laravel application starter kits](/docs/{{version}}/starter-kits). @@ -158,7 +158,7 @@ public function boot(): void } ``` -> [!NOTE] +> [!NOTE] > To learn more about mail notifications, please consult the [mail notification documentation](/docs/{{version}}/notifications#mail-notifications). diff --git a/views.md b/views.md index 6c03fa37bb2..f162919bf88 100644 --- a/views.md +++ b/views.md @@ -37,7 +37,7 @@ Route::get('/', function () { }); ``` -> [!NOTE] +> [!NOTE] > Looking for more information on how to write Blade templates? Check out the full [Blade documentation](/docs/{{version}}/blade) to get started. @@ -85,7 +85,7 @@ Views may also be nested within subdirectories of the `resources/views` director return view('admin.profile', $data); ``` -> [!WARNING] +> [!WARNING] > View directory names should not contain the `.` character. diff --git a/vite.md b/vite.md index 4d478f9fe39..23a4050c617 100644 --- a/vite.md +++ b/vite.md @@ -38,7 +38,7 @@ Laravel integrates seamlessly with Vite by providing an official plugin and Blade directive to load your assets for development and production. -> [!NOTE] +> [!NOTE] > Are you running Laravel Mix? Vite has replaced Laravel Mix in new Laravel installations. For Mix documentation, please visit the [Laravel Mix](https://laravel-mix.com/) website. If you would like to switch to Vite, please see our [migration guide](https://github.com/laravel/vite-plugin/blob/main/UPGRADE.md#migrating-from-laravel-mix-to-vite). @@ -56,7 +56,7 @@ Have you started a new Laravel application using our Vite scaffolding but need t ## Installation & Setup -> [!NOTE] +> [!NOTE] > The following documentation discusses how to manually install and configure the Laravel Vite plugin. However, Laravel's [starter kits](/docs/{{version}}/starter-kits) already include all of this scaffolding and are the fastest way to get started with Laravel and Vite. @@ -346,7 +346,7 @@ export default defineConfig({ }); ``` -> [!NOTE] +> [!NOTE] > Laravel's [starter kits](/docs/{{version}}/starter-kits) already include the proper Laravel, Vue, and Vite configuration.These starter kits offer the fastest way to get started with Laravel, Vue, and Vite. @@ -384,7 +384,7 @@ You will also need to include the additional `@viteReactRefresh` Blade directive The `@viteReactRefresh` directive must be called before the `@vite` directive. -> [!NOTE] +> [!NOTE] > Laravel's [starter kits](/docs/{{version}}/starter-kits) already include the proper Laravel, React, and Vite configuration.These starter kits offer the fastest way to get started with Laravel, React, and Vite. @@ -409,7 +409,7 @@ createInertiaApp({ If you are using Vite's code splitting feature with Inertia, we recommend configuring [asset prefetching](#asset-prefetching). -> [!NOTE] +> [!NOTE] > Laravel's [starter kits](/docs/{{version}}/starter-kits) already include the proper Laravel, Inertia, and Vite configuration.These starter kits offer the fastest way to get started with Laravel, Inertia, and Vite. @@ -445,7 +445,7 @@ The following example demonstrates how Vite will treat relative and absolute URL ## Working With Stylesheets -> [!NOTE] +> [!NOTE] > Laravel's [starter kits](/docs/{{version}}/starter-kits) already include the proper Tailwind and Vite configuration. Or, if you would like to use Tailwind and Laravel without using one of our starter kits, check out [Tailwind's installation guide for Laravel](https://tailwindcss.com/docs/guides/laravel). All Laravel applications already include Tailwind and a properly configured `vite.config.js` file. So, you only need to start the Vite development server or run the `dev` Composer command, which will start both the Laravel and Vite development servers: @@ -757,7 +757,7 @@ If you are using [SSR with Inertia](https://inertiajs.com/server-side-rendering) php artisan inertia:start-ssr ``` -> [!NOTE] +> [!NOTE] > Laravel's [starter kits](/docs/{{version}}/starter-kits) already include the proper Laravel, Inertia SSR, and Vite configuration.These starter kits offer the fastest way to get started with Laravel, Inertia SSR, and Vite. @@ -883,7 +883,7 @@ Vite::useStyleTagAttributes(fn (string $src, string $url, array|null $chunk, arr ]); ``` -> [!WARNING] +> [!WARNING] > The `$chunk` and `$manifest` arguments will be `null` while the Vite development server is running.