Staff.php 696 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. class Staff extends Model
  6. {
  7. use HasFactory;
  8. protected $fillable = [
  9. 'lastname',
  10. 'firstname',
  11. 'middlename',
  12. 'position_id',
  13. 'position_id',
  14. 'air_time',
  15. 'passport_data',
  16. 'phone',
  17. 'birth_date',
  18. 'address',
  19. 'in_flight'
  20. ];
  21. public function position()
  22. {
  23. return $this->belongsTo('App\Models\Position');
  24. }
  25. public function __toString(): string
  26. {
  27. return "{$this->lastname} {$this->firstname} {$this->middlename} {$this->passport_data}";
  28. }
  29. }