Files
airline-agency/app/Models/Airline.php
T

56 lines
902 B
PHP

<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class Airline
*
* @property int $id
* @property string $name
* @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
*/
class Airline extends Model
{
protected $table = 'airlines';
public static $snakeAttributes = false;
protected $casts = [
'country_id' => 'int',
'status' => 'int'
];
protected $fillable = [
'name',
'country_id',
'phone',
'status'
];
public function country()
{
return $this->belongsTo(Country::class);
}
public function flights()
{
return $this->hasMany(Flight::class);
}
}