When, I want to create a recording I have this error message?
BadMethodCallException in => C:\wamp64\www\exemple\vendor\laravel\framework\src\Illuminate\Support\Traits\Macroable.php line 74: Method validate does not exist.
I don't understand the problem?
Controller - Student
public function index()
    {
        $students = Student::oldest()->paginate(5);
        return view('admin.students.index', compact('students'))
          ->with('i', (request()->input('page',1) -1)*5);
    }
    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        return view('admin.students.create', compact('students'));
    }
    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        $request->validate([
                'name' => 'required',
                'firstname' => 'required'
        ]);
       $exists = Student::where('name', $request->get('name'))->where('firstname', $request->get('firstname'))->count();
       if (!$exists){
            Student::create($request->all());
            return redirect()->route('students.index')
                ->with('success', 'new data created successfully');
        }
        else{
            return redirect()->route('students.index')
                ->with('error', 'doublon');
        }   
    }

 
    