rodrigo1990:
I have this code to push products into array session in Laravel 5.4
public function agregarACarrito(Request $request)
{
$producto = new Producto();
$producto = Producto::with('marca')
->where('id', '=', $request->parametros)
->get();
$request->session()->push('session_products', $producto);
}
So, i want to Delete an item using AJAX, this is my code right now, doing this, the respond is always the default value:
public function borrarDeCarrito(Request $request)
{
$value = $request->session()->pull($request->parametros, 'default');
return $value;
}
And if i try this
$value = $request->session()->get('session_products')->pull($request->parametros, 'default');
return $value;
I get a 500 internal server error
¿what i'm doing wrong ?
Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE