Just started with your package.
From readme
Cart::add('293ad', 'Product 1', 1, 9.99);
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Gloudemans\Shoppingcart\Cart;
use App\Product;
use App\Http\Requests;
class CartController extends Controller
{
public function add($id)
{
$product = Product::find($id);
$item = Cart::add($product->id, $product->title, 1, 9.99);
dd($item);
}
}
where i am wrong ? Thanks.
You're using the cart class instead of the facade. Change the use statement to the facade
oops, ok thanks :)
also if i am there, is that good idea to use your plugin with Angular on front side?
use Gloudemans\Shoppingcart\Facades\Cart;
Ofcourse you can use it with Angular
ok, thanks tomorrow i will continue.
Maybe you can help me, which way is correct. Create some .factory('Cart') and after for example i press Add to cart product - send to backend and save this information in Angular Cookies? And in "routeChangeEvent" checking cookies + backend or how? Do i need use cookies on frontend side? :)
Thanks.
I'm not that familiar with Angular, so I can help you, sorry!
Most helpful comment
You're using the cart class instead of the facade. Change the use statement to the facade