refactor: update models relations
This commit is contained in:
@@ -15,12 +15,13 @@ use Illuminate\Database\Eloquent\Model;
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $country
|
||||
* @property int $country_id
|
||||
* @property string $phone
|
||||
* @property int $status
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property Country $country
|
||||
* @property Collection|Flight[] $flights
|
||||
*
|
||||
* @package App\Models
|
||||
@@ -31,16 +32,22 @@ class Airline extends Model
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'country_id' => 'int',
|
||||
'status' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'country',
|
||||
'country_id',
|
||||
'phone',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function country()
|
||||
{
|
||||
return $this->belongsTo(Country::class);
|
||||
}
|
||||
|
||||
public function flights()
|
||||
{
|
||||
return $this->hasMany(Flight::class);
|
||||
|
||||
Reference in New Issue
Block a user