feat: add booking management
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Booking
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property int|null $tour_id
|
||||
* @property int|null $flight_id
|
||||
* @property string $booking_code
|
||||
* @property string $first_name
|
||||
* @property string $last_name
|
||||
* @property string|null $national_code
|
||||
* @property string $mobile
|
||||
* @property string|null $email
|
||||
* @property int $passengers
|
||||
* @property float $price
|
||||
* @property int $status
|
||||
* @property string $payment_status
|
||||
* @property string|null $notes
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property User $user
|
||||
* @property Tour|null $tour
|
||||
* @property Flight|null $flight
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Booking extends Model
|
||||
{
|
||||
protected $table = 'bookings';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'user_id' => 'int',
|
||||
'tour_id' => 'int',
|
||||
'flight_id' => 'int',
|
||||
'passengers' => 'int',
|
||||
'price' => 'float',
|
||||
'status' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'tour_id',
|
||||
'flight_id',
|
||||
'booking_code',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'national_code',
|
||||
'mobile',
|
||||
'email',
|
||||
'passengers',
|
||||
'price',
|
||||
'status',
|
||||
'payment_status',
|
||||
'notes'
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function tour()
|
||||
{
|
||||
return $this->belongsTo(Tour::class);
|
||||
}
|
||||
|
||||
public function flight()
|
||||
{
|
||||
return $this->belongsTo(Flight::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user