1 | <?php namespace Arcanesoft\Auth\ViewComposers; |
||
15 | abstract class ViewComposer |
||
16 | { |
||
17 | /* ------------------------------------------------------------------------------------------------ |
||
18 | | Properties |
||
19 | | ------------------------------------------------------------------------------------------------ |
||
20 | */ |
||
21 | /** |
||
22 | * The View instance. |
||
23 | * |
||
24 | * @var \Illuminate\Contracts\View\View |
||
25 | */ |
||
26 | protected $view; |
||
27 | |||
28 | /** |
||
29 | * Caching time. |
||
30 | * |
||
31 | * @var int |
||
32 | */ |
||
33 | protected $minutes = 5; |
||
34 | |||
35 | /* ------------------------------------------------------------------------------------------------ |
||
36 | | Main Functions |
||
37 | | ------------------------------------------------------------------------------------------------ |
||
38 | */ |
||
39 | /** |
||
40 | * Get all cached users. |
||
41 | * |
||
42 | * @return \Illuminate\Database\Eloquent\Collection |
||
43 | */ |
||
44 | public function getCachedUsers() |
||
50 | |||
51 | /** |
||
52 | * Get all cached roles. |
||
53 | * |
||
54 | * @return \Illuminate\Database\Eloquent\Collection |
||
55 | */ |
||
56 | public function getCachedRoles() |
||
62 | |||
63 | /** |
||
64 | * Get all cached permissions. |
||
65 | * |
||
66 | * @return \Illuminate\Database\Eloquent\Collection |
||
67 | */ |
||
68 | protected function getCachedPermissions() |
||
74 | |||
75 | /* ------------------------------------------------------------------------------------------------ |
||
76 | | Other Functions |
||
77 | | ------------------------------------------------------------------------------------------------ |
||
78 | */ |
||
79 | /** |
||
80 | * Cache the results. |
||
81 | * |
||
82 | * @param string $name |
||
83 | * @param \Closure $callback |
||
84 | * |
||
85 | * @return mixed |
||
86 | */ |
||
87 | protected function cacheResults($name, Closure $callback) |
||
91 | } |
||
92 |