rules fixed logic

This commit is contained in:
Mahri Ilmedova 2022-08-12 13:53:03 +05:00
parent da4761e4f2
commit 0a49726dbd
2 changed files with 4 additions and 4 deletions

View File

@ -17,8 +17,8 @@ class CategoryRule implements InvokableRule
*/
public function __invoke($attribute, $value, $fail)
{
$category = Category::find($value);
if($category){
$category = Category::find((int)$value);
if(!$category){
$fail('There is no :attribute with value: ' . $value);
}
}

View File

@ -17,8 +17,8 @@ class TicketRule implements InvokableRule
*/
public function __invoke($attribute, $value, $fail)
{
$ticket = Ticket::find($value);
if($ticket){
$ticket = Ticket::find((int)$value);
if(!$ticket){
$fail('There is no :attribute with value: ' . $value);
}
}