Loading...
🛠️ Laravel

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

Admin Published on 17 May, 2021

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

Admin Published on 17 May, 2021

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