Файловый менеджер - Редактировать - /home/clickysoft/public_html/travel-guru.clickysoft.net/app/Models/Appointment.php
Назад
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Appointment extends Model { use HasFactory; protected $fillable = ['user_id', 'agent_id', 'date', 'time_slot_id']; public function timeSlot() { return $this->belongsTo(TimeSlot::class); } public function user() { return $this->belongsTo(User::class, 'user_id'); } public function agent() { return $this->belongsTo(User::class, 'agent_id'); } public static function createUnique($attributes) { $exists = self::where('user_id', $attributes['user_id']) ->where('agent_id', $attributes['agent_id']) ->where('date', $attributes['date']) ->where('time_slot_id', $attributes['time_slot_id']) ->exists(); if (!$exists) { return self::create($attributes); } return null; // or throw an exception or handle as needed } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка