feat: final updates

This commit is contained in:
2026-08-22 11:11:28 -07:00
parent 618a3d4cd9
commit d4bb1b9414
43 changed files with 1136 additions and 375 deletions
+3 -3
View File
@@ -11,14 +11,14 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class Airport
*
*
* @property int $id
* @property string $name
* @property int $city_id
* @property string $country
* @property string $code
*
* @property City $city
*
* @property City $cities
* @property Collection|Flight[] $flights
*
* @package App\Models
+7 -3
View File
@@ -11,11 +11,11 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class City
*
*
* @property int $id
* @property int $province_id
* @property string $name
*
*
* @property Province $province
* @property Collection|User[] $users
*
@@ -24,7 +24,6 @@ use Illuminate\Database\Eloquent\Model;
class City extends Model
{
protected $table = 'cities';
public $timestamps = false;
public static $snakeAttributes = false;
protected $casts = [
@@ -45,4 +44,9 @@ class City extends Model
{
return $this->hasMany(User::class);
}
public function airports()
{
return $this->hasMany(Airport::class);
}
}
+4 -2
View File
@@ -31,7 +31,6 @@ use Illuminate\Database\Eloquent\Model;
* @property int $status
* @property Carbon $created_at
* @property Carbon $updated_at
*
* @property Airline $airline
* @property File|null $file
* @property Airport $airport
@@ -53,7 +52,8 @@ class Flight extends Model
'price' => 'float',
'capacity' => 'int',
'views' => 'int',
'status' => FlightStatus::class
'status' => FlightStatus::class,
'return_time' => 'datetime',
];
protected $fillable = [
@@ -72,6 +72,8 @@ class Flight extends Model
'status',
'created_by',
'updated_by',
'return_time',
];
protected $hidden = [
+2 -3
View File
@@ -11,10 +11,10 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class Province
*
*
* @property int $id
* @property string $name
*
*
* @property Collection|City[] $cities
* @property Collection|User[] $users
*
@@ -23,7 +23,6 @@ use Illuminate\Database\Eloquent\Model;
class Province extends Model
{
protected $table = 'provinces';
public $timestamps = false;
public static $snakeAttributes = false;
protected $fillable = [
+28 -19
View File
@@ -30,7 +30,7 @@ use Illuminate\Foundation\Auth\User as Authenticated;
* @property string $username
* @property string $password
* @property string $province
* @property string $city
* @property string $cities
* @property int $status
* @property Carbon $created_at
* @property Carbon $updated_at
@@ -58,24 +58,23 @@ class User extends Authenticated
'password'
];
protected $fillable = [
'first_name',
'last_name',
'national_code',
'gender',
'marital_status',
'spouse_name',
'mobile',
'email',
'file_id',
'username',
'password',
'province',
'city',
'status',
'deleted'
];
protected $fillable = [
'first_name',
'last_name',
'national_code',
'gender',
'marital_status',
'spouse_name',
'mobile',
'email',
'file_id',
'username',
'password',
'province_id',
'city_id',
'status',
'deleted'
];
public function file()
{
return $this->belongsTo(File::class);
@@ -95,4 +94,14 @@ class User extends Authenticated
{
return $this->hasMany(Wishlist::class);
}
public function province()
{
return $this->belongsTo(Province::class);
}
public function city()
{
return $this->belongsTo(City::class, 'city_id');
}
}