commit 12.01
This commit is contained in:
@@ -1,39 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// бронирование клиентов
|
||||
class Booking extends Model {
|
||||
|
||||
class Booking extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'bookings';
|
||||
|
||||
|
||||
protected $fillable = [
|
||||
'bookingnumber',
|
||||
'booking_number',
|
||||
'client_id',
|
||||
'employee_id',
|
||||
'service_id',
|
||||
'bookingdate',
|
||||
'starttime',
|
||||
'endtime',
|
||||
'booking_date',
|
||||
'start_time',
|
||||
'end_time',
|
||||
'status',
|
||||
'cancelledby',
|
||||
'cancelreason'
|
||||
'cancelled_by',
|
||||
'cancel_reason'
|
||||
];
|
||||
|
||||
// списки броней
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
||||
// Связь с услугой
|
||||
public function service()
|
||||
{
|
||||
return $this->belongsTo(Service::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user