1 | <?php |
||
13 | abstract class AbstractController extends Controller |
||
14 | { |
||
15 | use DispatchesJobs; |
||
16 | use ValidatesRequests; |
||
17 | use AuthorizesRequests; |
||
18 | |||
19 | /** |
||
20 | * The authentication guard. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $guard; |
||
25 | |||
26 | /** |
||
27 | * The broker name. |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $broker; |
||
32 | |||
33 | /** |
||
34 | * Whitelisted methods. |
||
35 | * Array of whitelisted methods which do not need to go through middleware. |
||
36 | * |
||
37 | * @var array |
||
38 | */ |
||
39 | protected $middlewareWhitelist = []; |
||
40 | |||
41 | /** |
||
42 | * Create a new abstract controller instance. |
||
43 | */ |
||
44 | public function __construct() |
||
54 | |||
55 | /** |
||
56 | * Guess guard from accessarea. |
||
57 | * |
||
58 | * @param string $accessarea |
||
59 | * |
||
60 | * @return string|null |
||
61 | */ |
||
62 | protected function guessGuard(string $accessarea): ?string |
||
66 | |||
67 | /** |
||
68 | * Guess broker from accessarea. |
||
69 | * |
||
70 | * @param string $accessarea |
||
71 | * |
||
72 | * @return string|null |
||
73 | */ |
||
74 | protected function guessBroker(string $accessarea): ?string |
||
78 | |||
79 | /** |
||
80 | * Get the broker to be used. |
||
81 | * |
||
82 | * @return string|null |
||
83 | */ |
||
84 | protected function getBroker(): ?string |
||
88 | |||
89 | /** |
||
90 | * Get the guard to be used during authentication. |
||
91 | * |
||
92 | * @return string|null |
||
93 | */ |
||
94 | protected function getGuard(): ?string |
||
98 | |||
99 | /** |
||
100 | * Get the guest middleware for the application. |
||
101 | */ |
||
102 | protected function getGuestMiddleware() |
||
106 | |||
107 | /** |
||
108 | * Get the auth middleware for the application. |
||
109 | * |
||
110 | * @return string |
||
111 | */ |
||
112 | protected function getAuthMiddleware(): string |
||
116 | } |
||
117 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.