1 | <?php |
||
67 | class Tenant extends BaseTenant implements HasMedia |
||
68 | { |
||
69 | use Taggable; |
||
70 | use Auditable; |
||
71 | use LogsActivity; |
||
72 | use HashidsTrait; |
||
73 | use HasMediaTrait; |
||
74 | use HasSocialAttributes; |
||
75 | |||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | */ |
||
79 | protected $fillable = [ |
||
80 | 'slug', |
||
81 | 'name', |
||
82 | 'description', |
||
83 | 'email', |
||
84 | 'website', |
||
85 | 'phone', |
||
86 | 'language_code', |
||
87 | 'country_code', |
||
88 | 'state', |
||
89 | 'city', |
||
90 | 'address', |
||
91 | 'postal_code', |
||
92 | 'launch_date', |
||
93 | 'timezone', |
||
94 | 'currency', |
||
95 | 'social', |
||
96 | 'style', |
||
97 | 'is_active', |
||
98 | ]; |
||
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | protected $casts = [ |
||
104 | 'slug' => 'string', |
||
105 | 'email' => 'string', |
||
106 | 'website' => 'string', |
||
107 | 'phone' => 'string', |
||
108 | 'country_code' => 'string', |
||
109 | 'language_code' => 'string', |
||
110 | 'state' => 'string', |
||
111 | 'city' => 'string', |
||
112 | 'address' => 'string', |
||
113 | 'postal_code' => 'string', |
||
114 | 'launch_date' => 'string', |
||
115 | 'timezone' => 'string', |
||
116 | 'currency' => 'string', |
||
117 | 'social' => 'array', |
||
118 | 'style' => 'string', |
||
119 | 'is_active' => 'boolean', |
||
120 | 'deleted_at' => 'datetime', |
||
121 | ]; |
||
122 | |||
123 | /** |
||
124 | * Indicates whether to log only dirty attributes or all. |
||
125 | * |
||
126 | * @var bool |
||
127 | */ |
||
128 | protected static $logOnlyDirty = true; |
||
129 | |||
130 | /** |
||
131 | * The attributes that are logged on change. |
||
132 | * |
||
133 | * @var array |
||
134 | */ |
||
135 | protected static $logFillable = true; |
||
136 | |||
137 | /** |
||
138 | * The attributes that are ignored on change. |
||
139 | * |
||
140 | * @var array |
||
141 | */ |
||
142 | protected static $ignoreChangedAttributes = [ |
||
143 | 'created_at', |
||
144 | 'updated_at', |
||
145 | 'deleted_at', |
||
146 | ]; |
||
147 | |||
148 | /** |
||
149 | * Create a new Eloquent model instance. |
||
150 | * |
||
151 | * @param array $attributes |
||
152 | */ |
||
153 | public function __construct(array $attributes = []) |
||
180 | |||
181 | /** |
||
182 | * Register media collections. |
||
183 | * |
||
184 | * @return void |
||
185 | */ |
||
186 | public function registerMediaCollections(): void |
||
191 | |||
192 | /** |
||
193 | * Get all attached managers to tenant. |
||
194 | * |
||
195 | * @return \Illuminate\Database\Eloquent\Relations\MorphToMany |
||
196 | */ |
||
197 | public function managers(): MorphToMany |
||
201 | |||
202 | /** |
||
203 | * Get the route key for the model. |
||
204 | * |
||
205 | * @return string |
||
206 | */ |
||
207 | public function getRouteKeyName() |
||
211 | } |
||
212 |