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(Request $request)
    {
        $input = $request->all();
        $input['pass']=Hash::make($request->pass);
        User::create($input);
        $id = DB::getPdo()->lastInsertId();
        return response()->json([
            'res'=>true,
            'message'=>'Usuario creado correctamente'
        ], 200);
    }
public function store ( Request $ request ) { $ input = $ request -> all ( ) ; $ input [ 'pass' ] = Hash :: make ( $ request -> pass ) ; User :: create ( $ input ) ; $ id = DB :: getPdo ( ) -> lastInsertId ( ) ; return response ( ) -> json ( [ 'res' => true , 'message' => 'Usuario creado correctamente' ] , 200 ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .