12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- class Crew extends Model
- {
- use HasFactory;
- protected $fillable = [
- 'staff_id',
- 'flight_id',
- 'staff_id',
- 'flight_id',
- 'commander'
- ];
- public function flight()
- {
- return $this->belongsTo('App\Models\Flight');
- }
- public function staff()
- {
- return $this->belongsTo('App\Models\Staff');
- }
- public function __toString(): string
- {
- return "{$this->staff} {$this->flight}";
- }
- }
|