mercredi 12 février 2020

Error "Trying to access array offset on value of type null" laravel store data

I have this store function for insert/create new user from admin panel:

public function store(Request $request)
{
    $this->validate($request, [
        'name' => 'required',
        'email' => 'required|email|unique:users,email',
        'password' => 'required|same:confirm-password'
    ]);


    $input = $request->all();
    $input['password'] = Hash::make($input['password']);


    User::create($input);

    return redirect()->route('admin.pages.users.index')
        ->with('success','User created successfully');
}

Now after submit I see this error:

"Trying to access array offset on value of type null"

How do can i fix this error?!



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2OOlrVb
via IFTTT

Aucun commentaire:

Enregistrer un commentaire