Search code examples
laravelargumentstypeerror

Argument 1 must be of the type string or null, object given


I get this error. https://i.sstatic.net/2CNld.jpg I haven't changed much either since it worked, mainly the html, weird. https://github.com/cubesacube/project


Solution

  • The problem was in your CustomerController at line 20:

    public function store() {
        Customer::create($this -> validatedData());
        return redirect(); //this is the problem
    }
    

    redirect() needs route name or url path like redirect('/home') or redirect('login')

    Reference HTTP Redirect