| 1 | <?php |
||
| 7 | class Signere |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * The callback that should be used to authenticate the package users. |
||
| 11 | * |
||
| 12 | * @var \Closure |
||
| 13 | */ |
||
| 14 | public static $authUsing; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Determine if the given request can access the paths. |
||
| 18 | * |
||
| 19 | * @param \Illuminate\Http\Request $request |
||
| 20 | * @return bool |
||
| 21 | */ |
||
| 22 | public static function check($request) |
||
| 23 | { |
||
| 24 | 44 | return (static::$authUsing ?: function () { |
|
| 25 | return app()->environment('local'); |
||
| 26 | 44 | })($request); |
|
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Set the callback that should be used to authenticate package users. |
||
| 31 | * |
||
| 32 | * @param \Closure $callback |
||
| 33 | * @return static |
||
| 34 | */ |
||
| 35 | 44 | public static function auth(Closure $callback) |
|
| 41 | } |
||
| 42 |