1 | <?php |
||
80 | class Contact extends BaseContact |
||
81 | { |
||
82 | use Taggable; |
||
83 | use Auditable; |
||
84 | use Tenantable; |
||
85 | use HashidsTrait; |
||
86 | use LogsActivity; |
||
87 | use HasSocialAttributes; |
||
88 | |||
89 | /** |
||
90 | * {@inheritdoc} |
||
91 | */ |
||
92 | protected $fillable = [ |
||
93 | 'entity_id', |
||
94 | 'entity_type', |
||
95 | 'source', |
||
96 | 'method', |
||
97 | 'given_name', |
||
98 | 'family_name', |
||
99 | 'title', |
||
100 | 'organization', |
||
101 | 'email', |
||
102 | 'phone', |
||
103 | 'fax', |
||
104 | 'country_code', |
||
105 | 'language_code', |
||
106 | 'birthday', |
||
107 | 'gender', |
||
108 | 'social', |
||
109 | 'national_id_type', |
||
110 | 'national_id', |
||
111 | 'source', |
||
112 | 'method', |
||
113 | 'notes', |
||
114 | 'tags', |
||
115 | ]; |
||
116 | |||
117 | /** |
||
118 | * {@inheritdoc} |
||
119 | */ |
||
120 | protected $casts = [ |
||
121 | 'entity_id' => 'integer', |
||
122 | 'entity_type' => 'string', |
||
123 | 'given_name' => 'string', |
||
124 | 'family_name' => 'string', |
||
125 | 'title' => 'string', |
||
126 | 'organization' => 'string', |
||
127 | 'email' => 'string', |
||
128 | 'phone' => 'string', |
||
129 | 'fax' => 'string', |
||
130 | 'country_code' => 'string', |
||
131 | 'language_code' => 'string', |
||
132 | 'birthday' => 'string', |
||
133 | 'gender' => 'string', |
||
134 | 'social' => 'array', |
||
135 | 'national_id_type' => 'string', |
||
136 | 'national_id' => 'string', |
||
137 | 'source' => 'string', |
||
138 | 'method' => 'string', |
||
139 | 'notes' => 'string', |
||
140 | 'deleted_at' => 'datetime', |
||
141 | ]; |
||
142 | |||
143 | /** |
||
144 | * The default rules that the model will validate against. |
||
145 | * |
||
146 | * @var array |
||
147 | */ |
||
148 | protected $rules = [ |
||
149 | 'entity_id' => 'required|integer', |
||
150 | 'entity_type' => 'required|string|max:150', |
||
151 | 'given_name' => 'required|string|max:150', |
||
152 | 'family_name' => 'nullable|string|max:150', |
||
153 | 'title' => 'nullable|string|max:150', |
||
154 | 'organization' => 'nullable|string|max:150', |
||
155 | 'email' => 'required|email|min:3|max:150', |
||
156 | 'phone' => 'nullable|phone:AUTO', |
||
157 | 'fax' => 'nullable|string|max:150', |
||
158 | 'country_code' => 'nullable|alpha|size:2|country', |
||
159 | 'language_code' => 'nullable|alpha|size:2|language', |
||
160 | 'birthday' => 'nullable|date_format:Y-m-d', |
||
161 | 'gender' => 'nullable|in:male,female', |
||
162 | 'social' => 'nullable', |
||
163 | 'national_id_type' => 'nullable|in:identification,passport,other', |
||
164 | 'national_id' => 'nullable|string|max:150', |
||
165 | 'source' => 'nullable|string|max:150', |
||
166 | 'method' => 'nullable|string|max:150', |
||
167 | 'notes' => 'nullable|string|max:10000', |
||
168 | 'tags' => 'nullable|array', |
||
169 | ]; |
||
170 | |||
171 | /** |
||
172 | * Indicates whether to log only dirty attributes or all. |
||
173 | * |
||
174 | * @var bool |
||
175 | */ |
||
176 | protected static $logOnlyDirty = true; |
||
177 | |||
178 | /** |
||
179 | * The attributes that are logged on change. |
||
180 | * |
||
181 | * @var array |
||
182 | */ |
||
183 | protected static $logFillable = true; |
||
184 | |||
185 | /** |
||
186 | * The attributes that are ignored on change. |
||
187 | * |
||
188 | * @var array |
||
189 | */ |
||
190 | protected static $ignoreChangedAttributes = [ |
||
191 | 'created_at', |
||
192 | 'updated_at', |
||
193 | 'deleted_at', |
||
194 | ]; |
||
195 | } |
||
196 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.