Skip to content

Commit 9e0d108

Browse files
authored
Adopt GitHub style of notes (laravel#8092)
1 parent 508559f commit 9e0d108

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+846
-426
lines changed

Diff for: artisan.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ All Laravel applications include Tinker by default. However, you may install Tin
6060
composer require laravel/tinker
6161
```
6262

63-
> {tip} Looking for a graphical UI for interacting with your Laravel application? Check out [Tinkerwell](https://tinkerwell.app)!
63+
> **Note**
64+
> Looking for a graphical UI for interacting with your Laravel application? Check out [Tinkerwell](https://tinkerwell.app)!
6465
6566
<a name="usage"></a>
6667
#### Usage
@@ -77,7 +78,8 @@ You can publish Tinker's configuration file using the `vendor:publish` command:
7778
php artisan vendor:publish --provider="Laravel\Tinker\TinkerServiceProvider"
7879
```
7980

80-
> {note} The `dispatch` helper function and `dispatch` method on the `Dispatchable` class depends on garbage collection to place the job on the queue. Therefore, when using tinker, you should use `Bus::dispatch` or `Queue::push` to dispatch jobs.
81+
> **Warning**
82+
> The `dispatch` helper function and `dispatch` method on the `Dispatchable` class depends on garbage collection to place the job on the queue. Therefore, when using tinker, you should use `Bus::dispatch` or `Queue::push` to dispatch jobs.
8183
8284
<a name="command-allow-list"></a>
8385
#### Command Allow List
@@ -154,7 +156,8 @@ Let's take a look at an example command. Note that we are able to request any de
154156
}
155157
}
156158

157-
> {tip} For greater code reuse, it is good practice to keep your console commands light and let them defer to application services to accomplish their tasks. In the example above, note that we inject a service class to do the "heavy lifting" of sending the e-mails.
159+
> **Note**
160+
> For greater code reuse, it is good practice to keep your console commands light and let them defer to application services to accomplish their tasks. In the example above, note that we inject a service class to do the "heavy lifting" of sending the e-mails.
158161
159162
<a name="closure-commands"></a>
160163
### Closure Commands
@@ -495,7 +498,8 @@ Sometimes, you may need more manual control over how a progress bar is advanced.
495498

496499
$bar->finish();
497500

498-
> {tip} For more advanced options, check out the [Symfony Progress Bar component documentation](https://symfony.com/doc/current/components/console/helpers/progressbar.html).
501+
> **Note**
502+
> For more advanced options, check out the [Symfony Progress Bar component documentation](https://symfony.com/doc/current/components/console/helpers/progressbar.html).
499503
500504
<a name="registering-commands"></a>
501505
## Registering Commands

Diff for: authentication.md

+12-6
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ Providers define how users are retrieved from your persistent storage. Laravel s
3939

4040
Your application's authentication configuration file is located at `config/auth.php`. This file contains several well-documented options for tweaking the behavior of Laravel's authentication services.
4141

42-
> {tip} Guards and providers should not be confused with "roles" and "permissions". To learn more about authorizing user actions via permissions, please refer to the [authorization](/docs/{{version}}/authorization) documentation.
42+
> **Note**
43+
> Guards and providers should not be confused with "roles" and "permissions". To learn more about authorizing user actions via permissions, please refer to the [authorization](/docs/{{version}}/authorization) documentation.
4344
4445
<a name="starter-kits"></a>
4546
### Starter Kits
@@ -114,7 +115,8 @@ And, if you would like to get started quickly, we are pleased to recommend [Lara
114115
<a name="authentication-quickstart"></a>
115116
## Authentication Quickstart
116117

117-
> {note} This portion of the documentation discusses authenticating users via the [Laravel application starter kits](/docs/{{version}}/starter-kits), which includes UI scaffolding to help you get started quickly. If you would like to integrate with Laravel's authentication systems directly, check out the documentation on [manually authenticating users](#authenticating-users).
118+
> **Warning**
119+
> This portion of the documentation discusses authenticating users via the [Laravel application starter kits](/docs/{{version}}/starter-kits), which includes UI scaffolding to help you get started quickly. If you would like to integrate with Laravel's authentication systems directly, check out the documentation on [manually authenticating users](#authenticating-users).
118120
119121
<a name="install-a-starter-kit"></a>
120122
### Install A Starter Kit
@@ -171,7 +173,8 @@ To determine if the user making the incoming HTTP request is authenticated, you
171173
// The user is logged in...
172174
}
173175

174-
> {tip} Even though it is possible to determine if a user is authenticated using the `check` method, you will typically use a middleware to verify that the user is authenticated before allowing the user access to certain routes / controllers. To learn more about this, check out the documentation on [protecting routes](/docs/{{version}}/authentication#protecting-routes).
176+
> **Note**
177+
> Even though it is possible to determine if a user is authenticated using the `check` method, you will typically use a middleware to verify that the user is authenticated before allowing the user access to certain routes / controllers. To learn more about this, check out the documentation on [protecting routes](/docs/{{version}}/authentication#protecting-routes).
175178
176179
<a name="protecting-routes"></a>
177180
### Protecting Routes
@@ -212,7 +215,8 @@ When attaching the `auth` middleware to a route, you may also specify which "gua
212215

213216
If you are using the Laravel Breeze or Laravel Jetstream [starter kits](/docs/{{version}}/starter-kits), rate limiting will automatically be applied to login attempts. By default, the user will not be able to login for one minute if they fail to provide the correct credentials after several attempts. The throttling is unique to the user's username / email address and their IP address.
214217

215-
> {tip} If you would like to rate limit other routes in your application, check out the [rate limiting documentation](/docs/{{version}}/routing#rate-limiting).
218+
> **Note**
219+
> If you would like to rate limit other routes in your application, check out the [rate limiting documentation](/docs/{{version}}/routing#rate-limiting).
216220
217221
<a name="authenticating-users"></a>
218222
## Manually Authenticating Users
@@ -272,7 +276,8 @@ If you wish, you may also add extra query conditions to the authentication query
272276
// Authentication was successful...
273277
}
274278

275-
> {note} In these examples, `email` is not a required option, it is merely used as an example. You should use whatever column name corresponds to a "username" in your database table.
279+
> **Warning**
280+
> In these examples, `email` is not a required option, it is merely used as an example. You should use whatever column name corresponds to a "username" in your database table.
276281
277282
The `attemptWhen` method, which receives a closure as its second argument, may be used to perform more extensive inspection of the potential user before actually authenticating the user. The closure receives the potential user and should return `true` or `false` to indicate if the user may be authenticated:
278283

@@ -464,7 +469,8 @@ When the `logoutOtherDevices` method is invoked, the user's other sessions will
464469

465470
While building your application, you may occasionally have actions that should require the user to confirm their password before the action is performed or before the user is redirected to a sensitive area of the application. Laravel includes built-in middleware to make this process a breeze. Implementing this feature will require you to define two routes: one route to display a view asking the user to confirm their password and another route to confirm that the password is valid and redirect the user to their intended destination.
466471

467-
> {tip} The following documentation discusses how to integrate with Laravel's password confirmation features directly; however, if you would like to get started more quickly, the [Laravel application starter kits](/docs/{{version}}/starter-kits) include support for this feature!
472+
> **Note**
473+
> The following documentation discusses how to integrate with Laravel's password confirmation features directly; however, if you would like to get started more quickly, the [Laravel application starter kits](/docs/{{version}}/starter-kits) include support for this feature!
468474
469475
<a name="password-confirmation-configuration"></a>
470476
### Configuration

Diff for: authorization.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ You do not need to choose between exclusively using gates or exclusively using p
3838
<a name="writing-gates"></a>
3939
### Writing Gates
4040

41-
> {note} Gates are a great way to learn the basics of Laravel's authorization features; however, when building robust Laravel applications you should consider using [policies](#creating-policies) to organize your authorization rules.
41+
> **Warning**
42+
> Gates are a great way to learn the basics of Laravel's authorization features; however, when building robust Laravel applications you should consider using [policies](#creating-policies) to organize your authorization rules.
4243
4344
Gates are simply closures that determine if a user is authorized to perform a given action. Typically, gates are defined within the `boot` method of the `App\Providers\AuthServiceProvider` class using the `Gate` facade. Gates always receive a user instance as their first argument and may optionally receive additional arguments such as a relevant Eloquent model.
4445

@@ -335,7 +336,8 @@ If you would like to define your own policy discovery logic, you may register a
335336
// Return the name of the policy class for the given model...
336337
});
337338

338-
> {note} Any policies that are explicitly mapped in your `AuthServiceProvider` will take precedence over any potentially auto-discovered policies.
339+
> **Warning**
340+
> Any policies that are explicitly mapped in your `AuthServiceProvider` will take precedence over any potentially auto-discovered policies.
339341
340342
<a name="writing-policies"></a>
341343
## Writing Policies
@@ -373,7 +375,8 @@ You may continue to define additional methods on the policy as needed for the va
373375

374376
If you used the `--model` option when generating your policy via the Artisan console, it will already contain methods for the `viewAny`, `view`, `create`, `update`, `delete`, `restore`, and `forceDelete` actions.
375377

376-
> {tip} All policies are resolved via the Laravel [service container](/docs/{{version}}/container), allowing you to type-hint any needed dependencies in the policy's constructor to have them automatically injected.
378+
> **Note**
379+
> All policies are resolved via the Laravel [service container](/docs/{{version}}/container), allowing you to type-hint any needed dependencies in the policy's constructor to have them automatically injected.
377380
378381
<a name="policy-responses"></a>
379382
### Policy Responses
@@ -525,7 +528,8 @@ For certain users, you may wish to authorize all actions within a given policy.
525528

526529
If you would like to deny all authorization checks for a particular type of user then you may return `false` from the `before` method. If `null` is returned, the authorization check will fall through to the policy method.
527530

528-
> {note} The `before` method of a policy class will not be called if the class doesn't contain a method with a name matching the name of the ability being checked.
531+
> **Warning**
532+
> The `before` method of a policy class will not be called if the class doesn't contain a method with a name matching the name of the ability being checked.
529533
530534
<a name="authorizing-actions-using-policies"></a>
531535
## Authorizing Actions Using Policies
@@ -692,7 +696,8 @@ The following controller methods will be mapped to their corresponding policy me
692696
| update | update |
693697
| destroy | delete |
694698

695-
> {tip} You may use the `make:policy` command with the `--model` option to quickly generate a policy class for a given model: `php artisan make:policy PostPolicy --model=Post`.
699+
> **Note**
700+
> You may use the `make:policy` command with the `--model` option to quickly generate a policy class for a given model: `php artisan make:policy PostPolicy --model=Post`.
696701
697702
<a name="via-middleware"></a>
698703
### Via Middleware

0 commit comments

Comments
 (0)