| Total Complexity | 4 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class LaravelBackupPanel |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The callback that should be used to authenticate Laravel Backup Panel users. |
||
| 12 | * |
||
| 13 | * @var Closure |
||
| 14 | */ |
||
| 15 | public static $authUsing; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Determine if the given request can access the Laravel Backup Panel dashboard. |
||
| 19 | * |
||
| 20 | * @param Request $request |
||
| 21 | * @return bool |
||
| 22 | */ |
||
| 23 | public static function check($request) |
||
| 24 | { |
||
| 25 | return (static::$authUsing ?: function () { |
||
| 26 | return app()->environment('local'); |
||
|
|
|||
| 27 | })($request); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Set the callback that should be used to authenticate Laravel Backup Panel users. |
||
| 32 | * |
||
| 33 | * @param Closure $callback |
||
| 34 | * @return static |
||
| 35 | */ |
||
| 36 | public static function auth(Closure $callback) |
||
| 37 | { |
||
| 38 | static::$authUsing = $callback; |
||
| 39 | |||
| 40 | return new static; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Get the default JavaScript variables for Laravel Backup Panel. |
||
| 45 | * |
||
| 46 | * @return array |
||
| 47 | */ |
||
| 48 | public static function scriptVariables() |
||
| 53 | ]; |
||
| 54 | } |
||
| 55 | } |
||
| 56 |