40 lines
859 B
PHP
40 lines
859 B
PHP
<?php
|
|
namespace App\Models;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
// бронирование клиентов
|
|
class Booking extends Model {
|
|
use HasFactory;
|
|
|
|
protected $table = 'bookings';
|
|
|
|
protected $fillable = [
|
|
'bookingnumber',
|
|
'client_id',
|
|
'employee_id',
|
|
'service_id',
|
|
'bookingdate',
|
|
'starttime',
|
|
'endtime',
|
|
'status',
|
|
'cancelledby',
|
|
'cancelreason'
|
|
];
|
|
|
|
// списки броней
|
|
public function service()
|
|
{
|
|
return $this->belongsTo(Services::class);
|
|
}
|
|
|
|
public function client()
|
|
{
|
|
return $this->belongsTo(User::class, 'client_id');
|
|
}
|
|
|
|
public function employee()
|
|
{
|
|
return $this->belongsTo(User::class, 'employee_id');
|
|
}
|
|
}
|