app/Http/Controllers/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(UserCreateRequest $request)
    {
        \Gate::authorize('edit', 'users');
        $user = User::create(
            $request->only('first_name', 'last_name', 'email', 'role_id')
                + ['password' => Hash::make(1234)]
        );
        return \response(new UserResource($user), Response::HTTP_CREATED);
    }
public function store ( UserCreateRequest $ request ) { \ Gate :: authorize ( 'edit' , 'users' ) ; $ user = User :: create ( $ request -> only ( 'first_name' , 'last_name' , 'email' , 'role_id' ) + [ 'password' => Hash :: make ( 1234 ) ] ) ; return \ response ( new UserResource ( $ user ) , Response :: HTTP_CREATED ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .