1 | <?php |
||
8 | class ActivityManager |
||
9 | { |
||
10 | /** |
||
11 | * @var HandlerInterface |
||
12 | */ |
||
13 | protected $handler; |
||
14 | |||
15 | /** |
||
16 | * @var \Illuminate\Auth\AuthManager |
||
17 | */ |
||
18 | protected $auth; |
||
19 | |||
20 | /** |
||
21 | * @var \Illuminate\Config\Repository |
||
22 | */ |
||
23 | protected $config; |
||
24 | |||
25 | /** |
||
26 | * @var \Illuminate\Database\Eloquent\Model |
||
27 | */ |
||
28 | protected $user; |
||
29 | |||
30 | /** |
||
31 | * Create the logsupervisor using a default Handler |
||
32 | * Also register Laravels Log Handler if needed. |
||
33 | * |
||
34 | * @param HandlerInterface $handler |
||
35 | * @param AuthManager $auth |
||
36 | * @param Config $config |
||
37 | */ |
||
38 | 4 | public function __construct(HandlerInterface $handler, AuthManager $auth, Config $config) |
|
44 | |||
45 | /** |
||
46 | * Log activity |
||
47 | * |
||
48 | * @param string $action |
||
49 | * @param string $description |
||
50 | * @param \Eloquent $model |
||
51 | * |
||
52 | * @return bool |
||
53 | */ |
||
54 | 2 | public function log($action, $description, $model = null) |
|
58 | |||
59 | /** |
||
60 | * Clean old log records. |
||
61 | * |
||
62 | * @return integer |
||
63 | */ |
||
64 | 1 | public function cleanLog() |
|
68 | |||
69 | /** |
||
70 | * Get User |
||
71 | * |
||
72 | * @return \Illuminate\Contracts\Auth\Authenticatable |
||
73 | */ |
||
74 | 2 | protected function getUser() |
|
83 | } |
||
84 |