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,
            'password' => Hash::make($request->password),
            'type'     => $request->type,
            'bio'      => $request->bio,
            '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 , 'password' => Hash :: make ( $ request -> password ) , 'type' => $ request -> type , 'bio' => $ request -> bio , 'photo' => $ request -> photo , ] ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// post user