Files
cleaning-company/app/Models/Booking.php
Владимир f5c68bf0c7 commit 08.01
2026-01-08 12:38:09 +00:00

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');
}
}