Файловый менеджер - Редактировать - /home/clickysoft/public_html/charliapp-v2.clickysoft.net/app/Rules/UserExistsInGroup.php
Назад
<?php namespace App\Rules; use Illuminate\Contracts\Validation\Rule; use App\Models\Group; class UserExistsInGroup implements Rule { /** * Create a new rule instance. * * @return void */ public function __construct() { // } /** * Determine if the validation rule passes. * * @param string $attribute * @param mixed $value * @return bool */ public function passes($attribute, $value) { $group = Group::find($value); if(!empty($group)) { return $group->members()->where("user_id", auth()->id())->exists() || $group->user_id == auth()->id(); } else { return false; } } /** * Get the validation error message. * * @return string */ public function message() { return 'You do not belong to this group.'; } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка