Level 122
Check against the docs. You need to call the validator on the request object and include an array of rules
https://laravel.com/docs/5.6/validation#quick-writing-the-validation-logic
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
using laravel 5.6 and in my controller I have following code,
$input = $request->all();
$validator = $this->validator($input);
if ($validator->passes()){
$booking = $this->create($input)->toArray();
$booking['link'] = str_random(30);
DB::table('activations')->insert(['id_user' => $booking['id'], 'token' => $booking['link']]);
Mail::send('mail.activation', $booking, function($message) use ($booking) {
$message->to($booking['email']);
$message->subject('acxian.com - Activation Code');
});
but when I try submit button following error is occurring,
1/1) BadMethodCallException
Method [validator] does not exist.
how can I fix this?
Please or to participate in this conversation.