Файловый менеджер - Редактировать - /home/clickysoft/public_html/securebeans.clickysoft.net/app/Rules/UniqueProduct.php
Назад
<?php namespace App\Rules; use App\Models\Product; use Illuminate\Contracts\Validation\Rule; class UniqueProduct 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) { foreach (Product::get() as $product) { if ($product['product_sku'] == $value) { return 0; } } return $value; } /** * Get the validation error message. * * @return string */ public function message() { return 'The Product Sku must be unique.'; } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка