app/Http/Controllers/API/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)
    {
        $this->validate($request,[
            'name'=>"required|string|max:191",
            'email'=>"required|string|email|max:191|unique:users",
            'password'=>"required|string|min:6",
        ]);
        return User::create([
           'name' =>$request['name'], 
           'email' =>$request['email'], 
           'type' =>$request['type'], 
           'bio' =>$request['bio'], 
           'password' =>Hash::make($request['password']), 
           'photo' =>$request['photo'], 
        ]);
    }
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'name' => " required|string|max:191 " , 'email' => " required|string|email|max:191|unique:users " , 'password' => " required|string|min:6 " , ] ) ; return User :: create ( [ 'name' => $ request [ 'name' ] , 'email' => $ request [ 'email' ] , 'type' => $ request [ 'type' ] , 'bio' => $ request [ 'bio' ] , 'password' => Hash :: make ( $ request [ 'password' ] ) , 'photo' => $ request [ 'photo' ] , ] ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .