app/Http/Controllers/UsuarioController.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)
    {
$res=$request->all();
$res['password']=bcrypt($res['password']);
             if($request->ajax()){
            User::create($res);
                return response()->json(['mensaje'=>$res]);
        }
    }
public function store ( Request $ request ) { $ res = $ request -> all ( ) ; $ res [ 'password' ] = bcrypt ( $ res [ 'password' ] ) ; if ( $ request -> ajax ( ) ) { User :: create ( $ res ) ; return response ( ) -> json ( [ 'mensaje' => $ res ] ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .
//bcrypt(); //return response()->json(['mensaje'=>$request->all()]);