app/Http/Controllers/Admin/UserController.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)
    {
        $rule=[
            'name'=>'required|string|min:2|max:255',
            'last_name'=>'required|string|min:2|max:255',
            'email'=>'required|string|min:11|max:255',
            'password'=>'required|string|min:8|max:64'
        ];
        $this->validate($request, $rule);
        $user=User::create([
            'name'=>$request->input('name'),
            'last_name'=>$request->input('name'),
            'email'=>$request->input('email'),
            'password'=>$request->input('password'),
            'type'=>$request->has('type') ? 1 : 0,
        ]);
        return redirect()->route('index-user'); 
    }
public function store ( Request $ request ) { $ rule = [ 'name' => 'required|string|min:2|max:255' , 'last_name' => 'required|string|min:2|max:255' , 'email' => 'required|string|min:11|max:255' , 'password' => 'required|string|min:8|max:64' ] ; $ this -> validate ( $ request , $ rule ) ; $ user = User :: create ( [ 'name' => $ request -> input ( 'name' ) , 'last_name' => $ request -> input ( 'name' ) , 'email' => $ request -> input ( 'email' ) , 'password' => $ request -> input ( 'password' ) , 'type' => $ request -> has ( 'type' ) ? 1 : 0 , ] ) ; return redirect ( ) -> route ( 'index-user' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .