PHPackages                             rayjun/laravel-order - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. rayjun/laravel-order

ActiveLibrary

rayjun/laravel-order
====================

Order for Laravel Application.

v1.0.1(10y ago)12206MITPHP

Since Jul 28Pushed 10y ago1 watchersCompare

[ Source](https://github.com/rayjun/laravel-order)[ Packagist](https://packagist.org/packages/rayjun/laravel-order)[ RSS](/packages/rayjun-laravel-order/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

laravel-order
=============

[](#laravel-order)

laravel 框架中的 order 组件。

安装
==

[](#安装)

可以直接在命令行中安装：

```
composer require "rayjun/laravel-order:1.0.*"

```

或者可以在你项目中 `composer.json` 中加入以下代码：

```
"require": {
    "rayjun/laravel-order": "1.0.*"
}

```

然后再执行:

```
composer update

```

在完成上面的安装之后，可以在 `config/app.php` 中的 `providers` 数组中增加以下代码：

```
'Rayjun\LaravelOrder\LaravelOrderServiceProvider'

```

然后增加一行到

```
'Order'   => 'Rayjun\LaravelOrder\Facades\Order',

```

使用
==

[](#使用)

创建一个订单
------

[](#创建一个订单)

```
Order Order::order(array $items, int $user_id);

```

获取一个订单
------

[](#获取一个订单)

```
Order Order::getOrder($order_id);

```

获取用户的订单
-------

[](#获取用户的订单)

```
Collection Order::getUserOrders($user_id);

```

更改订单状态
------

[](#更改订单状态)

```
boolean Order::updateStatus(int $order_id, string $status);

```

删除一个订单
------

[](#删除一个订单)

```
boolean Order::deleteOrder(int $order_id);

```

更新订单项数量
-------

[](#更新订单项数量)

```
OrderItem Order::updateQty(int $item_id, int qty);

```

计算订单总价格
-------

[](#计算订单总价格)

```
float Order::total($order_id);

```

计算商品总数量
-------

[](#计算商品总数量)

```
int Order::count($order_id);

```

更新订单商品数量和总价
-----------

[](#更新订单商品数量和总价)

```
boolean Order::updateOrder($order_id);

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3948d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/234d216a029cba9368022444279173d49fd40a2955ee190c05304528f0c49f36?d=identicon)[rayjun](/maintainers/rayjun)

---

Top Contributors

[![rayjun](https://avatars.githubusercontent.com/u/7517993?v=4)](https://github.com/rayjun "rayjun (4 commits)")

---

Tags

laravelorder

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rayjun-laravel-order/health.svg)

```
[![Health](https://phpackages.com/badges/rayjun-laravel-order/health.svg)](https://phpackages.com/packages/rayjun-laravel-order)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[cmgmyr/messenger

Simple user messaging tool for Laravel

2.6k2.4M6](/packages/cmgmyr-messenger)[spatie/laravel-health

Monitor the health of a Laravel application

86910.0M83](/packages/spatie-laravel-health)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
