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(UserConfigurationRequest $request)
    {          
                $users = new Users;
                $users->email = $request->email;
                $users->username = $request->username;
                $users->full_name = $request->fullname;
                $users->level = !empty($request->level)?$request->level:null;
                $users->nick_name = $request->nickname;
                $users->password = bcrypt($request->password);
                $users->password_confirmation = bcrypt($request->password_confirmation);
                $users->birthdate = !empty($request->birthdate)? $request->birthdate : null;
		        $users->start_working_date = !empty($request->start_working_date)? $request->start_working_date : null;
                $users->stop_working_date = !empty($request->stop_working_date)? $request->stop_working_date : null;
                $users->status =  !empty($request->status)? $request->status : null;
                $users->position = !empty($request->position)? $request->position : null;
                $users->rank = !empty($request->rank) ? $request->rank : null;
                $users->contract = !empty($request->contract) ? $request->contract : null;
                $validated = $request->validated();
                $users->save();
                return response()->json(['data'=>['users_id'=>$users->id]]);
            }
public function store ( UserConfigurationRequest $ request ) { $ users = new Users ; $ users -> email = $ request -> email ; $ users -> username = $ request -> username ; $ users -> full_name = $ request -> fullname ; $ users -> level = ! empty ( $ request -> level ) ? $ request -> level : null ; $ users -> nick_name = $ request -> nickname ; $ users -> password = bcrypt ( $ request -> password ) ; $ users -> password_confirmation = bcrypt ( $ request -> password_confirmation ) ; $ users -> birthdate = ! empty ( $ request -> birthdate ) ? $ request -> birthdate : null ; $ users -> start_working_date = ! empty ( $ request -> start_working_date ) ? $ request -> start_working_date : null ; $ users -> stop_working_date = ! empty ( $ request -> stop_working_date ) ? $ request -> stop_working_date : null ; $ users -> status = ! empty ( $ request -> status ) ? $ request -> status : null ; $ users -> position = ! empty ( $ request -> position ) ? $ request -> position : null ; $ users -> rank = ! empty ( $ request -> rank ) ? $ request -> rank : null ; $ users -> contract = ! empty ( $ request -> contract ) ? $ request -> contract : null ; $ validated = $ request -> validated ( ) ; $ users -> save ( ) ; return response ( ) -> json ( [ 'data' => [ 'users_id' => $ users -> id ] ] ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// \Log::info($request->level);  // $users->username = $request->username;