Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 2 |
CommandMonitoring | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 2 |
resolveRouteBinding | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
serializeDate | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
1 | <?php |
2 | |
3 | namespace Qmp\Laravel\CommandsLaravel\Models; |
4 | |
5 | use Carbon\Carbon; |
6 | use Illuminate\Support\Facades\Log; |
7 | use Qmp\Laravel\ApiFilterRequest\Traits\TraitFilterModel; |
8 | |
9 | class CommandMonitoring extends \Moloquent |
10 | { |
11 | use TraitFilterModel; |
12 | |
13 | protected $carbonDates = ['created_at', 'updated_at']; |
14 | |
15 | /** |
16 | * Undocumented variable |
17 | * |
18 | * @var string |
19 | */ |
20 | protected $connection = 'monitoringMongo'; |
21 | |
22 | /** |
23 | * Undocumented variable |
24 | * |
25 | * @var string |
26 | */ |
27 | protected $collection = 'command'; |
28 | |
29 | |
30 | /** |
31 | * Undocumented variable |
32 | * |
33 | * @var array |
34 | */ |
35 | protected $guarded = ['_id']; |
36 | |
37 | /** |
38 | * Undocumented function |
39 | * |
40 | * @param [type] $value |
41 | * @return void |
42 | */ |
43 | public function resolveRouteBinding($value, $field = null) |
44 | { |
45 | return $this->where('id', $value)->first() ?? abort(422, 'Datas not found'); |
46 | } |
47 | |
48 | /** |
49 | * Prepare a date for array / JSON serialization. |
50 | * |
51 | * @param \DateTimeInterface $date |
52 | * @return string |
53 | */ |
54 | protected function serializeDate(\DateTimeInterface $date) |
55 | { |
56 | return $date->format('Y-m-d H:i:s'); |
57 | } |
58 | } |