| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?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');
- }
- }
|