VCard.php
1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
namespace App\Models;
use App\Models\Pivots\GoalNegativeKeywordSharedSet;
use App\Models\Pivots\GoalVCard;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Collection;
class VCard extends Model
{
use SoftDeletes;
protected $table = 'v_cards';
protected $fillable = [
'external_id',
'campaign_external_id',
'campaign_id',
'country',
'city',
'work_time',
'phone',
'street',
'house',
'building',
'apartment',
'instant_messenger',
'company_name',
'extra_message',
'contact_email',
'ogrn',
'metro_station_id',
'point_on_map',
'contact_person',
];
protected $casts = [
'phone' => 'json',
'instant_messenger' => 'json',
'point_on_map' => 'json',
];
/**
* @return Collection
*/
static public function getPropertiesWatch()
{
return collect([
'country',
'city',
'work_time',
'phone',
'street',
'house',
'building',
'apartment',
'instant_messenger',
'company_name',
'extra_message',
'contact_email',
'ogrn',
'metro_station_id',
'point_on_map',
'contact_person',
]);
}
public function goalVCards()
{
return $this->hasMany(GoalVCard::class, 'v_card_id');
}
}