1 | <?php |
||
8 | class AddCustomProvider |
||
9 | { |
||
10 | /** |
||
11 | * The default provder of api guard. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $defaultApiProvider; |
||
16 | |||
17 | /** |
||
18 | * Handle an incoming request. Set the `provider` from `api` guard using a |
||
19 | * parameter `provider` coming from request. The provider on `apì` guard |
||
20 | * is used by Laravel Passport to get the correct model on access token |
||
21 | * creation. |
||
22 | * |
||
23 | * @param \Illuminate\Http\Request $request |
||
24 | * @param \Closure $next |
||
25 | * @return mixed |
||
26 | */ |
||
27 | 9 | public function handle(Request $request, Closure $next) |
|
40 | |||
41 | /** |
||
42 | * Reset config provider to default after complete request. If necessary |
||
43 | * can receive $request and $response params. To be used the attribute |
||
44 | * $this->defaultApiProvider the middleware was registered on ServiceProvider |
||
45 | * as a singleton. |
||
46 | * Read more in https://laravel.com/docs/5.6/middleware#terminable-middleware. |
||
47 | * |
||
48 | * @return void |
||
49 | */ |
||
50 | 9 | public function terminate() |
|
54 | } |
||
55 |