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