1 | <?php |
||
21 | class Image extends Model implements HasMedia |
||
22 | { |
||
23 | use SoftDeletes, AdminModelTrait, HasMediaTrait; |
||
24 | |||
25 | /** |
||
26 | * The database table used by the model. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $table = 'image'; |
||
31 | |||
32 | /** |
||
33 | * The attributes that should be mutated to dates. |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
||
38 | |||
39 | /** |
||
40 | * The attributes that are mass assignable. |
||
41 | * |
||
42 | * @var array |
||
43 | */ |
||
44 | protected $fillable = ['name', 'description', 'alt', 'url']; |
||
45 | |||
46 | /** |
||
47 | * Columns to exclude from index |
||
48 | * |
||
49 | * @var array |
||
50 | */ |
||
51 | protected $excludedFromIndex = []; |
||
52 | |||
53 | /** |
||
54 | * Hidden from custom find |
||
55 | * |
||
56 | * @var arrat |
||
57 | */ |
||
58 | protected $excludedFromFind = []; |
||
59 | |||
60 | /** |
||
61 | * Fields to search in fulltext mode |
||
62 | * |
||
63 | * @var array |
||
64 | */ |
||
65 | protected $fulltextFields = [ |
||
66 | 'id', |
||
67 | 'name' => [ |
||
68 | 'operator' => 'LIKE', |
||
69 | 'prefix' => '%', |
||
70 | 'sufix' => '%' |
||
71 | ], |
||
72 | 'description' => [ |
||
73 | 'operator' => 'LIKE', |
||
74 | 'prefix' => '%', |
||
75 | 'sufix' => '%' |
||
76 | ], |
||
77 | 'alt' => [ |
||
78 | 'operator' => 'LIKE', |
||
79 | 'prefix' => '%', |
||
80 | 'sufix' => '%' |
||
81 | ], |
||
82 | 'url' => [ |
||
83 | 'operator' => 'LIKE', |
||
84 | 'prefix' => '%', |
||
85 | 'sufix' => '%' |
||
86 | ], |
||
87 | ]; |
||
88 | |||
89 | /** |
||
90 | * Default order by |
||
91 | * |
||
92 | * @type array |
||
93 | */ |
||
94 | protected $defaultOrderBy = [ |
||
95 | 'id' => 'desc' |
||
96 | ]; |
||
97 | |||
98 | /** |
||
99 | * Image category link |
||
100 | * |
||
101 | * @return object |
||
102 | */ |
||
103 | public function imagecategories(){ |
||
107 | |||
108 | /** |
||
109 | * Slide link |
||
110 | * |
||
111 | * @return object |
||
112 | */ |
||
113 | public function slides(){ |
||
117 | |||
118 | /** |
||
119 | * Article category |
||
120 | * |
||
121 | * @return object |
||
122 | */ |
||
123 | public function articlecategories(){ |
||
127 | |||
128 | /** |
||
129 | * Article category |
||
130 | * |
||
131 | * @return object |
||
132 | */ |
||
133 | public function pages(){ |
||
137 | |||
138 | /** |
||
139 | * Process relationships |
||
140 | * |
||
141 | * @param query $query |
||
142 | * @return query |
||
143 | */ |
||
144 | public function scopeRelationships($query){ |
||
148 | |||
149 | /** |
||
150 | * Hide fields |
||
151 | * |
||
152 | * @param array $array |
||
153 | */ |
||
154 | public function hide($array = []){ |
||
158 | } |
||
159 |