Total Complexity | 3 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class PersistManager |
||
6 | { |
||
7 | /** |
||
8 | * Indicates if laravel should run migrations for package. |
||
9 | * |
||
10 | * @var bool |
||
11 | */ |
||
12 | public static bool $runsMigrations = false; |
||
13 | |||
14 | /** |
||
15 | * UsedContactModel. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | public static string $model = \RecentlyViewed\Models\RecentViews::class; |
||
20 | |||
21 | /** |
||
22 | * Check is persistent storage enabled. |
||
23 | * |
||
24 | * @return bool |
||
25 | */ |
||
26 | 10 | public static function isEnabled(): bool |
|
27 | { |
||
28 | 10 | return (bool) config('recently-viewed.persist_enabled'); |
|
29 | } |
||
30 | /** |
||
31 | * Configure laravel to not register current package migrations. |
||
32 | * |
||
33 | * @return static |
||
34 | */ |
||
35 | 8 | public static function enableMigrations(): static |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * Specify contact model to use. |
||
44 | * |
||
45 | * @param string $modelClass |
||
46 | * @return static |
||
47 | */ |
||
48 | 1 | public static function useRecentlyViewedModel(string $modelClass): static |
|
55 |