Files
cleaning-company/app/Models/Booking.php
Владимир ae5ab2554b commit 12.01
2026-01-12 14:25:15 +00:00

42 lines
855 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Booking extends Model
{
use HasFactory;
protected $fillable = [
'booking_number',
'client_id',
'employee_id',
'service_id',
'booking_date',
'start_time',
'end_time',
'status',
'cancelled_by',
'cancel_reason'
];
// Связь с клиентом
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);
}
}