init
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Airline
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $country
|
||||
* @property string $mobile
|
||||
* @property int $status
|
||||
* @property int $created_at
|
||||
* @property int $updated_at
|
||||
*
|
||||
* @property Collection|Flight[] $flights
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Airline extends Model
|
||||
{
|
||||
protected $table = 'airlines';
|
||||
|
||||
protected $casts = [
|
||||
'status' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'country',
|
||||
'mobile',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function flights()
|
||||
{
|
||||
return $this->hasMany(Flight::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
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 Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property Collection|Flight[] $flights
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Airport extends Model
|
||||
{
|
||||
protected $table = 'airports';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'city',
|
||||
'country'
|
||||
];
|
||||
|
||||
public function flights()
|
||||
{
|
||||
return $this->hasMany(Flight::class, 'origin_airports_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class File
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $extenion
|
||||
* @property int $size
|
||||
* @property string $original_name
|
||||
* @property string $path
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property Collection|Tour[] $tours
|
||||
* @property Collection|User[] $users
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class File extends Model
|
||||
{
|
||||
protected $table = 'files';
|
||||
|
||||
protected $casts = [
|
||||
'size' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'extenion',
|
||||
'size',
|
||||
'original_name',
|
||||
'path'
|
||||
];
|
||||
|
||||
public function tours()
|
||||
{
|
||||
return $this->hasMany(Tour::class);
|
||||
}
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany(User::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Flight
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $flight_number
|
||||
* @property int $airline_id
|
||||
* @property int $origin_airports_id
|
||||
* @property int $destination_airports_id
|
||||
* @property Carbon $start_time
|
||||
* @property Carbon $end_time
|
||||
* @property int $price
|
||||
* @property int $capacity
|
||||
* @property int $status
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property Airline $airline
|
||||
* @property Airport $airport
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Flight extends Model
|
||||
{
|
||||
protected $table = 'flights';
|
||||
|
||||
protected $casts = [
|
||||
'airline_id' => 'int',
|
||||
'origin_airports_id' => 'int',
|
||||
'destination_airports_id' => 'int',
|
||||
'start_time' => 'datetime',
|
||||
'end_time' => 'datetime',
|
||||
'price' => 'int',
|
||||
'capacity' => 'int',
|
||||
'status' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'flight_number',
|
||||
'airline_id',
|
||||
'origin_airports_id',
|
||||
'destination_airports_id',
|
||||
'start_time',
|
||||
'end_time',
|
||||
'price',
|
||||
'capacity',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function airline()
|
||||
{
|
||||
return $this->belongsTo(Airline::class);
|
||||
}
|
||||
|
||||
public function airport()
|
||||
{
|
||||
return $this->belongsTo(Airport::class, 'origin_airports_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Tour
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $title
|
||||
* @property int $file_id
|
||||
* @property string $tour_type
|
||||
* @property string $summary
|
||||
* @property string $description
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property File $file
|
||||
* @property Collection|TourDetail[] $tour_details
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Tour extends Model
|
||||
{
|
||||
protected $table = 'tours';
|
||||
|
||||
protected $casts = [
|
||||
'file_id' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'file_id',
|
||||
'tour_type',
|
||||
'summary',
|
||||
'description'
|
||||
];
|
||||
|
||||
public function file()
|
||||
{
|
||||
return $this->belongsTo(File::class);
|
||||
}
|
||||
|
||||
public function tour_details()
|
||||
{
|
||||
return $this->hasMany(TourDetail::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class TourDetail
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $tour_id
|
||||
* @property Carbon $start_date
|
||||
* @property Carbon $end_date
|
||||
* @property int $price
|
||||
* @property int $capacity
|
||||
* @property int $status
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property Tour $tour
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class TourDetail extends Model
|
||||
{
|
||||
protected $table = 'tour_details';
|
||||
|
||||
protected $casts = [
|
||||
'tour_id' => 'int',
|
||||
'start_date' => 'datetime',
|
||||
'end_date' => 'datetime',
|
||||
'price' => 'int',
|
||||
'capacity' => 'int',
|
||||
'status' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'tour_id',
|
||||
'start_date',
|
||||
'end_date',
|
||||
'price',
|
||||
'capacity',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function tour()
|
||||
{
|
||||
return $this->belongsTo(Tour::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class User
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $first_name
|
||||
* @property string $last_name
|
||||
* @property string $national_code
|
||||
* @property bool $gender
|
||||
* @property int $marital_status
|
||||
* @property string|null $spouse_name
|
||||
* @property int $file_id
|
||||
* @property string $mobile
|
||||
* @property string $email
|
||||
* @property string $user_name
|
||||
* @property string $password
|
||||
* @property string $user_province
|
||||
* @property string $user_city
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property string|null $deleted_at
|
||||
*
|
||||
* @property File $file
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class User extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
protected $table = 'users';
|
||||
|
||||
protected $casts = [
|
||||
'gender' => 'bool',
|
||||
'marital_status' => 'int',
|
||||
'file_id' => 'int'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'password'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'first_name',
|
||||
'last_name',
|
||||
'national_code',
|
||||
'gender',
|
||||
'marital_status',
|
||||
'spouse_name',
|
||||
'file_id',
|
||||
'mobile',
|
||||
'email',
|
||||
'user_name',
|
||||
'password',
|
||||
'user_province',
|
||||
'user_city'
|
||||
];
|
||||
|
||||
public function file()
|
||||
{
|
||||
return $this->belongsTo(File::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user