UnitHistory.php 1022 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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|null $content
  12. * @property bool $visible_to_franchisee
  13. * @property \Carbon\Carbon $created_at
  14. * @property \Carbon\Carbon $updated_at
  15. * @property \Carbon\Carbon|null $deleted_at
  16. * @property-read \App\Models\Unit $unit
  17. */
  18. class UnitHistory extends Model
  19. {
  20. use HasFactory, SoftDeletes;
  21. protected $table = 'unit_histories';
  22. protected $guarded = ['id'];
  23. protected $casts = [
  24. 'visible_to_franchisee' => 'boolean',
  25. 'created_at' => 'datetime',
  26. 'updated_at' => 'datetime',
  27. 'deleted_at' => 'datetime',
  28. ];
  29. public function unit(): BelongsTo
  30. {
  31. return $this->belongsTo(Unit::class, 'unit_id');
  32. }
  33. }