refactor: update models relations

This commit is contained in:
2026-08-16 17:00:01 +03:30
parent bd0e1aab31
commit a226931a77
5 changed files with 56 additions and 21 deletions
+9 -2
View File
@@ -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);