You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> {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.
81
83
82
84
<aname="command-allow-list"></a>
83
85
#### 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
154
156
}
155
157
}
156
158
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.
158
161
159
162
<aname="closure-commands"></a>
160
163
### Closure Commands
@@ -495,7 +498,8 @@ Sometimes, you may need more manual control over how a progress bar is advanced.
495
498
496
499
$bar->finish();
497
500
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).
Copy file name to clipboardExpand all lines: authentication.md
+12-6
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,8 @@ Providers define how users are retrieved from your persistent storage. Laravel s
39
39
40
40
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.
41
41
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.
43
44
44
45
<aname="starter-kits"></a>
45
46
### Starter Kits
@@ -114,7 +115,8 @@ And, if you would like to get started quickly, we are pleased to recommend [Lara
114
115
<aname="authentication-quickstart"></a>
115
116
## Authentication Quickstart
116
117
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).
118
120
119
121
<aname="install-a-starter-kit"></a>
120
122
### Install A Starter Kit
@@ -171,7 +173,8 @@ To determine if the user making the incoming HTTP request is authenticated, you
171
173
// The user is logged in...
172
174
}
173
175
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).
175
178
176
179
<aname="protecting-routes"></a>
177
180
### Protecting Routes
@@ -212,7 +215,8 @@ When attaching the `auth` middleware to a route, you may also specify which "gua
212
215
213
216
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.
214
217
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).
216
220
217
221
<aname="authenticating-users"></a>
218
222
## Manually Authenticating Users
@@ -272,7 +276,8 @@ If you wish, you may also add extra query conditions to the authentication query
272
276
// Authentication was successful...
273
277
}
274
278
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.
276
281
277
282
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:
278
283
@@ -464,7 +469,8 @@ When the `logoutOtherDevices` method is invoked, the user's other sessions will
464
469
465
470
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.
466
471
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!
Copy file name to clipboardExpand all lines: authorization.md
+10-5
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,8 @@ You do not need to choose between exclusively using gates or exclusively using p
38
38
<aname="writing-gates"></a>
39
39
### Writing Gates
40
40
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.
42
43
43
44
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.
44
45
@@ -335,7 +336,8 @@ If you would like to define your own policy discovery logic, you may register a
335
336
// Return the name of the policy class for the given model...
336
337
});
337
338
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.
339
341
340
342
<aname="writing-policies"></a>
341
343
## Writing Policies
@@ -373,7 +375,8 @@ You may continue to define additional methods on the policy as needed for the va
373
375
374
376
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.
375
377
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.
377
380
378
381
<aname="policy-responses"></a>
379
382
### Policy Responses
@@ -525,7 +528,8 @@ For certain users, you may wish to authorize all actions within a given policy.
525
528
526
529
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.
527
530
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.
529
533
530
534
<aname="authorizing-actions-using-policies"></a>
531
535
## Authorizing Actions Using Policies
@@ -692,7 +696,8 @@ The following controller methods will be mapped to their corresponding policy me
692
696
| update | update |
693
697
| destroy | delete |
694
698
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`.
0 commit comments