1 | <?php |
||
43 | class Log extends Activity |
||
44 | { |
||
45 | use ValidatingTrait; |
||
46 | use CacheableEloquent; |
||
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | protected $fillable = [ |
||
52 | 'log_name', |
||
53 | 'description', |
||
54 | 'subject_id', |
||
55 | 'subject_type', |
||
56 | 'causer_id', |
||
57 | 'causer_type', |
||
58 | 'properties', |
||
59 | ]; |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | protected $casts = [ |
||
65 | 'properties' => 'collection', |
||
66 | 'log_name' => 'string', |
||
67 | 'description' => 'string', |
||
68 | 'subject_id' => 'integer', |
||
69 | 'subject_type' => 'string', |
||
70 | 'causer_id' => 'integer', |
||
71 | 'causer_type' => 'string', |
||
72 | ]; |
||
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | protected $observables = [ |
||
78 | 'validating', |
||
79 | 'validated', |
||
80 | ]; |
||
81 | |||
82 | /** |
||
83 | * The default rules that the model will validate against. |
||
84 | * |
||
85 | * @var array |
||
86 | */ |
||
87 | protected $rules = [ |
||
88 | 'log_name' => 'required|string|max:150', |
||
89 | 'description' => 'nullable|string|max:10000', |
||
90 | 'subject_id' => 'nullable|integer', |
||
91 | 'subject_type' => 'nullable|string|max:150', |
||
92 | 'causer_id' => 'nullable|integer', |
||
93 | 'causer_type' => 'nullable|string|max:150', |
||
94 | ]; |
||
95 | |||
96 | /** |
||
97 | * Whether the model should throw a |
||
98 | * ValidationException if it fails validation. |
||
99 | * |
||
100 | * @var bool |
||
101 | */ |
||
102 | protected $throwValidationExceptions = true; |
||
103 | |||
104 | /** |
||
105 | * Create a new Log model instance. |
||
106 | * |
||
107 | * @param array $attributes |
||
108 | */ |
||
109 | public function __construct(array $attributes = []) |
||
115 | } |
||
116 |