app/Http/Controllers/auth/RegisterController.php
/**
     * Store a newly created resource in storage.
     *
     * @param \Illuminate\Http\Request $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        if (Auth::check()){
            return redirect(route('/'));
        }
        $validated = $request->validate([
            'name' => 'required|string',
            'surname' => 'required|string',
            'email' => 'required|string|email',
            'birth_date' => 'required|string',
            'password' => 'required|string'
        ]);
        $candidate = Candidate::create($validated);
        if ($candidate) {
            Auth::login($candidate);
            return redirect(route('/'));
        }
    }
public function store ( Request $ request ) { if ( Auth :: check ( ) ) { return redirect ( route ( '/' ) ) ; } $ validated = $ request -> validate ( [ 'name' => 'required|string' , 'surname' => 'required|string' , 'email' => 'required|string|email' , 'birth_date' => 'required|string' , 'password' => 'required|string' ] ) ; $ candidate = Candidate :: create ( $ validated ) ; if ( $ candidate ) { Auth :: login ( $ candidate ) ; return redirect ( route ( '/' ) ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .