UnitMedia.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  6. use Illuminate\Database\Eloquent\SoftDeletes;
  7. /**
  8. * @property int $id
  9. * @property int $unit_id
  10. * @property string $title
  11. * @property string $file_url
  12. * @property string|null $mime_type
  13. * @property bool $visible_to_franchisee
  14. * @property \Carbon\Carbon $created_at
  15. * @property \Carbon\Carbon $updated_at
  16. * @property \Carbon\Carbon|null $deleted_at
  17. * @property-read \App\Models\Unit $unit
  18. */
  19. class UnitMedia extends Model
  20. {
  21. use HasFactory, SoftDeletes;
  22. protected $table = 'unit_media';
  23. protected $guarded = ['id'];
  24. protected $casts = [
  25. 'visible_to_franchisee' => 'boolean',
  26. 'created_at' => 'datetime',
  27. 'updated_at' => 'datetime',
  28. 'deleted_at' => 'datetime',
  29. ];
  30. public function unit(): BelongsTo
  31. {
  32. return $this->belongsTo(Unit::class, 'unit_id');
  33. }
  34. }