42 lines
662 B
PHP
42 lines
662 B
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class Airport
|
|
*
|
|
* @property int $id
|
|
* @property string $name
|
|
* @property string $city
|
|
* @property string $country
|
|
* @property Carbon $created_at
|
|
* @property Carbon $updated_at
|
|
*
|
|
* @property Collection|Flight[] $flights
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class Airport extends Model
|
|
{
|
|
protected $table = 'airports';
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'city',
|
|
'country'
|
|
];
|
|
|
|
public function flights()
|
|
{
|
|
return $this->hasMany(Flight::class, 'origin_airports_id');
|
|
}
|
|
}
|