Welcome Guest, Not a member yet? Register   Sign In
Validation doesn't work
#3

If your validation fail and you want to return view with errors it will be better to use 


PHP Code:
// Controller:            
if (!$this->validate([
   'judul' => 'required|is_unique[comic.judul]',
])) {
   return view('comic/create', [
       'errors' => $this->validator->getErrors(),
   ]);
}

// View:

isset($errors['judul']) ? 'is-invalid' ''
Reply


Messages In This Thread
Validation doesn't work - by Tokioshy - 02-27-2024, 07:15 PM
RE: Validation doesn't work - by kenjis - 02-27-2024, 09:25 PM
RE: Validation doesn't work - by Tokioshy - 02-28-2024, 01:47 AM
RE: Validation doesn't work - by MZahov - 02-27-2024, 10:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB