init
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
abstract class Controller
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?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 string $code
|
||||
* @property int $file_id
|
||||
* @property int $status
|
||||
* @property Carbon $created_at
|
||||
*
|
||||
* @property Collection|Flight[] $flights
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Airline extends Model
|
||||
{
|
||||
protected $table = 'airlines';
|
||||
public $timestamps = false;
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'file_id' => 'int',
|
||||
'status' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'code',
|
||||
'file_id',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function flights()
|
||||
{
|
||||
return $this->hasMany(Flight::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Airport
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $city
|
||||
* @property string $code
|
||||
* @property string $country
|
||||
*
|
||||
* @property Collection|Flight[] $flights
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Airport extends Model
|
||||
{
|
||||
protected $table = 'airports';
|
||||
public $timestamps = false;
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'city',
|
||||
'code',
|
||||
'country'
|
||||
];
|
||||
|
||||
public function flights()
|
||||
{
|
||||
return $this->hasMany(Flight::class, 'deprature_airport_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Booking
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property int $flight_id
|
||||
* @property int $tour_date_id
|
||||
* @property int $adult_count
|
||||
* @property int $child_count
|
||||
* @property int $total_price
|
||||
* @property string $tracking_code
|
||||
* @property Carbon $created_at
|
||||
* @property int $status
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property Booking $booking
|
||||
* @property Flight $flight
|
||||
* @property TourDate $tourDate
|
||||
* @property Collection|Booking[] $bookings
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Booking extends Model
|
||||
{
|
||||
protected $table = 'bookings';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'user_id' => 'int',
|
||||
'flight_id' => 'int',
|
||||
'tour_date_id' => 'int',
|
||||
'adult_count' => 'int',
|
||||
'child_count' => 'int',
|
||||
'total_price' => 'int',
|
||||
'status' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'flight_id',
|
||||
'tour_date_id',
|
||||
'adult_count',
|
||||
'child_count',
|
||||
'total_price',
|
||||
'tracking_code',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class, 'user_id');
|
||||
}
|
||||
|
||||
public function flight()
|
||||
{
|
||||
return $this->belongsTo(Flight::class);
|
||||
}
|
||||
|
||||
public function tourDate()
|
||||
{
|
||||
return $this->belongsTo(TourDate::class);
|
||||
}
|
||||
|
||||
public function bookings()
|
||||
{
|
||||
return $this->hasMany(Booking::class, 'user_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class BookingPassenger
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $booking_id
|
||||
* @property string $first_name
|
||||
* @property string $last_name
|
||||
* @property string $national_code
|
||||
* @property int $passenger_type
|
||||
* @property Carbon $birth_date
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class BookingPassenger extends Model
|
||||
{
|
||||
protected $table = 'booking_passengers';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'booking_id' => 'int',
|
||||
'passenger_type' => 'int',
|
||||
'birth_date' => 'datetime'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'booking_id',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'national_code',
|
||||
'passenger_type',
|
||||
'birth_date'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Comment
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property string $comment
|
||||
* @property int $status
|
||||
* @property Carbon $created_at
|
||||
*
|
||||
* @property User $user
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Comment extends Model
|
||||
{
|
||||
protected $table = 'comments';
|
||||
public $timestamps = false;
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'user_id' => 'int',
|
||||
'status' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'comment',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?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 $extension
|
||||
* @property int $size
|
||||
* @property string $original_name
|
||||
* @property string $path
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property Collection|Flight[] $flights
|
||||
* @property Collection|Tour[] $tours
|
||||
* @property Collection|User[] $users
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class File extends Model
|
||||
{
|
||||
protected $table = 'files';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'size' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'extension',
|
||||
'size',
|
||||
'original_name',
|
||||
'path'
|
||||
];
|
||||
|
||||
public function flights()
|
||||
{
|
||||
return $this->hasMany(Flight::class);
|
||||
}
|
||||
|
||||
public function tours()
|
||||
{
|
||||
return $this->hasMany(Tour::class);
|
||||
}
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany(User::class, 'image_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Flight
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $title
|
||||
* @property string $summary
|
||||
* @property int $arrival_aiport_id
|
||||
* @property int $file_id
|
||||
* @property int $flight_type
|
||||
* @property int $departure_time
|
||||
* @property float $price
|
||||
* @property int $deprature_airport_id
|
||||
* @property string $destination
|
||||
* @property int $airline_id
|
||||
* @property int $capacity
|
||||
* @property int $status
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property Airline $airline
|
||||
* @property File $file
|
||||
* @property Airport $airport
|
||||
* @property Collection|Booking[] $bookings
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Flight extends Model
|
||||
{
|
||||
protected $table = 'flights';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'arrival_aiport_id' => 'int',
|
||||
'file_id' => 'int',
|
||||
'flight_type' => 'int',
|
||||
'departure_time' => 'int',
|
||||
'price' => 'float',
|
||||
'deprature_airport_id' => 'int',
|
||||
'airline_id' => 'int',
|
||||
'capacity' => 'int',
|
||||
'status' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'summary',
|
||||
'arrival_aiport_id',
|
||||
'file_id',
|
||||
'flight_type',
|
||||
'departure_time',
|
||||
'price',
|
||||
'deprature_airport_id',
|
||||
'destination',
|
||||
'airline_id',
|
||||
'capacity',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function airline()
|
||||
{
|
||||
return $this->belongsTo(Airline::class);
|
||||
}
|
||||
|
||||
public function file()
|
||||
{
|
||||
return $this->belongsTo(File::class);
|
||||
}
|
||||
|
||||
public function airport()
|
||||
{
|
||||
return $this->belongsTo(Airport::class, 'deprature_airport_id');
|
||||
}
|
||||
|
||||
public function bookings()
|
||||
{
|
||||
return $this->hasMany(Booking::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?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 string $summary
|
||||
* @property string $descriptions
|
||||
* @property int $file_id
|
||||
* @property string $origin
|
||||
* @property string $destination
|
||||
* @property int $duration
|
||||
* @property int $status
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property File $file
|
||||
* @property Collection|TourDate[] $tourDates
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Tour extends Model
|
||||
{
|
||||
protected $table = 'tours';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'file_id' => 'int',
|
||||
'duration' => 'int',
|
||||
'status' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'summary',
|
||||
'descriptions',
|
||||
'file_id',
|
||||
'origin',
|
||||
'destination',
|
||||
'duration',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function file()
|
||||
{
|
||||
return $this->belongsTo(File::class);
|
||||
}
|
||||
|
||||
public function tourDates()
|
||||
{
|
||||
return $this->hasMany(TourDate::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class TourDate
|
||||
*
|
||||
* @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
|
||||
* @property Collection|Booking[] $bookings
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class TourDate extends Model
|
||||
{
|
||||
protected $table = 'tour_dates';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
public function bookings()
|
||||
{
|
||||
return $this->hasMany(Booking::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
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 int $gender
|
||||
* @property int $marital_status
|
||||
* @property string|null $spouse_name
|
||||
* @property string $mobile
|
||||
* @property string $email
|
||||
* @property int|null $image_id
|
||||
* @property string $username
|
||||
* @property string $password
|
||||
* @property string $password_confirmation
|
||||
* @property string $user_province
|
||||
* @property string $user_city
|
||||
* @property int|null $status
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updatet_at
|
||||
* @property string $deleted_at
|
||||
*
|
||||
* @property File|null $file
|
||||
* @property Collection|Comment[] $comments
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class User extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
protected $table = 'users';
|
||||
public $timestamps = false;
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'gender' => 'int',
|
||||
'marital_status' => 'int',
|
||||
'image_id' => 'int',
|
||||
'status' => 'int',
|
||||
'updatet_at' => 'datetime'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'password'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'first_name',
|
||||
'last_name',
|
||||
'national_code',
|
||||
'gender',
|
||||
'marital_status',
|
||||
'spouse_name',
|
||||
'mobile',
|
||||
'email',
|
||||
'image_id',
|
||||
'username',
|
||||
'password',
|
||||
'password_confirmation',
|
||||
'user_province',
|
||||
'user_city',
|
||||
'status',
|
||||
'updatet_at'
|
||||
];
|
||||
|
||||
public function file()
|
||||
{
|
||||
return $this->belongsTo(File::class, 'image_id');
|
||||
}
|
||||
|
||||
public function comments()
|
||||
{
|
||||
return $this->hasMany(Comment::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user