| Total Complexity | 6 |
| Total Lines | 66 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class LaravelBackupPanel |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * The callback that should be used to authenticate Laravel Backup Panel users. |
||
| 14 | * |
||
| 15 | * @var Closure |
||
| 16 | */ |
||
| 17 | public static $authUsing; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Determine if the given request can access the Laravel Backup Panel dashboard. |
||
| 21 | * |
||
| 22 | * @param Request $request |
||
| 23 | * @return bool |
||
| 24 | */ |
||
| 25 | public static function check($request) |
||
| 26 | { |
||
| 27 | return (static::$authUsing ?: function () { |
||
| 28 | return app()->environment('local'); |
||
|
|
|||
| 29 | })($request); |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Set the callback that should be used to authenticate Laravel Backup Panel users. |
||
| 34 | * |
||
| 35 | * @param Closure $callback |
||
| 36 | * @return static |
||
| 37 | */ |
||
| 38 | public static function auth(Closure $callback) |
||
| 39 | { |
||
| 40 | static::$authUsing = $callback; |
||
| 41 | |||
| 42 | return new static; |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Get the default JavaScript variables for Laravel Backup Panel. |
||
| 47 | * |
||
| 48 | * @return array |
||
| 49 | */ |
||
| 50 | public static function scriptVariables() |
||
| 56 | ] |
||
| 57 | ); |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Determine if Laravel Backup Panel's published assets are up-to-date. |
||
| 62 | * |
||
| 63 | * @return bool |
||
| 64 | * |
||
| 65 | * @throws RuntimeException |
||
| 66 | */ |
||
| 67 | private static function assetsAreCurrent() |
||
| 76 | } |
||
| 77 | } |
||
| 78 |