Loading...

Một số third-party hữu ích cho laravel


1. Laracademy Generators

  • Tạo một motel từ table sau khi đã tạo từ mirgration
  • Ví dụ: php artisan generate:modelfromtable –table=posts –folder=App/Models –singular

2. Laravel Shopping Cart

  • Ví dụ add giỏ hàng
\Cart::add(
    [
        'id' => uniqid(),
        'name' => $product->title,
        'price' => $price,
        'quantity' => $params['quantity'],
        'attributes' => [],
        'associatedModel' => $product,
    ]
);
  • Remove item
\Cart::remove($rowId);

3. Phần quyền:

4. Tạo code generate

# Bài viết cùng chuyên mục