|
|
@@ -0,0 +1,51 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace App\Models;
|
|
|
+
|
|
|
+use Illuminate\Database\Eloquent\Model;
|
|
|
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
|
+
|
|
|
+class Reclamation extends Model
|
|
|
+{
|
|
|
+ protected $fillable = [
|
|
|
+ 'order_id',
|
|
|
+ 'user_id',
|
|
|
+ 'reason',
|
|
|
+ 'guarantee',
|
|
|
+ 'whats_done',
|
|
|
+ 'create_date',
|
|
|
+ 'finish_date',
|
|
|
+ ];
|
|
|
+
|
|
|
+ public function order(): BelongsTo
|
|
|
+ {
|
|
|
+ return $this->belongsTo(Order::class);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function user(): BelongsTo
|
|
|
+ {
|
|
|
+ return $this->belongsTo(User::class);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function photos_before(): BelongsToMany
|
|
|
+ {
|
|
|
+ return $this->belongsToMany(File::class, 'reclamation_photo_before');
|
|
|
+ }
|
|
|
+
|
|
|
+ public function photos_after(): BelongsToMany
|
|
|
+ {
|
|
|
+ return $this->belongsToMany(File::class, 'reclamation_photo_after');
|
|
|
+ }
|
|
|
+
|
|
|
+ public function documents(): BelongsToMany
|
|
|
+ {
|
|
|
+ return $this->belongsToMany(File::class, 'reclamation_document');
|
|
|
+ }
|
|
|
+
|
|
|
+ public function acts(): BelongsToMany
|
|
|
+ {
|
|
|
+ return $this->belongsToMany(File::class, 'reclamation_act');
|
|
|
+ }
|
|
|
+
|
|
|
+}
|