UnitContract.php 898 B

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