1

furture more it says.

in Controller.php line 82.

at Controller->__call('validate', array(object(Request), array('email' => 'required|string', 'password' => 'required|string')))
in AuthenticatesUsers.php line 63

note: every thing was working fine till yesterday morning.my laravel version is 5.4.36.

2 Answers 2

1

Put this line in your class

 use ValidatesRequests;

Right below

 class classname ...... {
   use ValidatesRequests;
 }
Sign up to request clarification or add additional context in comments.

3 Comments

in which class i need to add these login or base or in authenticatesusers
@DJEntertainment the class in which you are using validate method.
yesterday i global php version 7.3 before 5.6 was global do that have any effect??
0

Your LoginController doesn't extend from the base Controller, App\Http\Controllers\Controller or this base class is missing a trait. This class was setup to use the Illuminate\Foundation\Validation\ValidatesRequests trait, which gives you the validate method.

If your base Controller does not use this trait, then you can add the use statement to use this trait so that you will have the validate method in all your Controllers.

6 Comments

can u kindly remotly have a look on my project for few mints.it would be a great help for me
If your LoginController extends that base Controller you should have the validate method, so it would mean that you are incorrect in assuming this Controller throwing the error extends from the base Controller mentioned in the answer, or that base Controller does not use the trait mentioned
class LoginController extends Controller this copied from my login controller besides that validate method is also there
protected function validateLogin(Request $request) { $this->validate($request, [ $this->username() => 'required|string', 'password' => 'required|string', ]); }
this is validate method can u check for me if there is any error
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.