UnitHistory.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 \Illuminate\Support\Carbon|null $created_at
  14. * @property \Illuminate\Support\Carbon|null $updated_at
  15. * @property \Illuminate\Support\Carbon|null $deleted_at
  16. * @property-read \App\Models\Unit $unit
  17. * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitHistory newModelQuery()
  18. * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitHistory newQuery()
  19. * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitHistory onlyTrashed()
  20. * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitHistory query()
  21. * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitHistory whereContent($value)
  22. * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitHistory whereCreatedAt($value)
  23. * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitHistory whereDeletedAt($value)
  24. * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitHistory whereId($value)
  25. * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitHistory whereTitle($value)
  26. * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitHistory whereUnitId($value)
  27. * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitHistory whereUpdatedAt($value)
  28. * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitHistory whereVisibleToFranchisee($value)
  29. * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitHistory withTrashed(bool $withTrashed = true)
  30. * @method static \Illuminate\Database\Eloquent\Builder<static>|UnitHistory withoutTrashed()
  31. * @mixin \Eloquent
  32. */
  33. class UnitHistory extends Model
  34. {
  35. use HasFactory, SoftDeletes;
  36. protected $table = 'unit_histories';
  37. protected $guarded = ['id'];
  38. protected $casts = [
  39. 'visible_to_franchisee' => 'boolean',
  40. 'created_at' => 'datetime',
  41. 'updated_at' => 'datetime',
  42. 'deleted_at' => 'datetime',
  43. ];
  44. public function unit(): BelongsTo
  45. {
  46. return $this->belongsTo(Unit::class, 'unit_id');
  47. }
  48. }