jasonc/laravel-order

商城订单

2.1.3 2021-03-10 08:40 UTC

This package is auto-updated.

Last update: 2022-06-10 13:04:10 UTC


README

1.安装

$ composer require jasonc/laravel-order
$ php artisan vendor:publish --tag="order"
$ php artisan migrate

User 模型引入

use Jason\Order\Traits\UserHasOrders;

2.订单部分

use Jason\Order\Facades\Order;

$item = new Item(ShouldOrder, $number);

$order = Order::user($user)
              ->address(Addressbook)
              ->create([$item]);

3.事件传播

Jason\Order\Events\OrderAudited 订单事件 Jason\Order\Events\Paid 订单支付