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
Copy file name to clipboardExpand all lines: README.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -219,7 +219,7 @@ $timing->getDuration();
219
219
```
220
220
221
221
222
-
## Sanctum dev auth
222
+
## Dev auth
223
223
224
224
Each `api` has authentication, and testing it via HTTP Client (ie postman) we spend a lot of time to login users and copy the token, put in the next request and so on. Well now Laravel Developer provides an easy way to authenticate users in `local` env using `testing` token:
225
225
@@ -228,31 +228,36 @@ Each `api` has authentication, and testing it via HTTP Client (ie postman) we sp
And send the request with the `Authorization` header value `testing`.
236
236
237
-
Note: Make sure the `DevSanctumAuthMiddleware` is placed before the `api` middleware.
237
+
Note: Make sure the `DevAuthMiddleware` is placed before the `api` middleware.
238
238
239
239
### Customize resolved user
240
240
241
241
By default, the first entry (usually user) from your config model `app.providers.users.model` will be used, however, you can customize that.
242
242
243
-
In any of yours service providers, or in the same place you inject the `DevSanctumAuthMiddleware` you can provide a callback which resolves the user instance:
243
+
In any of yours service providers, or in the same place you inject the `DevAuthMiddleware` you can provide a callback which resolves the user instance:
244
244
245
245
```php
246
246
use App\Models\User;
247
-
use Binarcode\LaravelDeveloper\Middleware\DevSanctumAuthMiddleware;
247
+
use Binarcode\LaravelDeveloper\Middleware\DevAuthMiddleware;
If you're using laravel sanctum, and want to explicitely use / generate a Bearer for the resolved user, you can use the `\Binarcode\LaravelDeveloper\Middleware\DevAuthMiddleware::class` instead, which follow the same syntax as the `DevAuthMiddleware`.
0 commit comments