rules fixed logic
This commit is contained in:
parent
da4761e4f2
commit
0a49726dbd
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue