init
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
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 string $code
|
||||
*
|
||||
* @property Collection|Flight[] $flights
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Airport extends Model
|
||||
{
|
||||
protected $table = 'airports';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'city',
|
||||
'country',
|
||||
'code'
|
||||
];
|
||||
|
||||
public function flights()
|
||||
{
|
||||
return $this->hasMany(Flight::class, 'departure_airport_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user