PHPackages                             vinlon/laravel-skeleton - 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. [Framework](/categories/framework)
4. /
5. vinlon/laravel-skeleton

ActiveProject[Framework](/categories/framework)

vinlon/laravel-skeleton
=======================

The Laravel Framework Skeleton

0.2.2(5y ago)1451MITPHPPHP ^7.3|^8.0

Since Dec 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/vinlon/laravel-skeleton)[ Packagist](https://packagist.org/packages/vinlon/laravel-skeleton)[ RSS](/packages/vinlon-laravel-skeleton/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (16)Versions (20)Used By (0)

Laravel Skeleton 应用开发基础模板
=========================

[](#laravel-skeleton-应用开发基础模板)

更新日志
----

[](#更新日志)

v0.2.0 升级larvel版本到8.x，默认引入调试工具telescope, [查看telescope使用文档](https://learnku.com/docs/laravel/8.x/telescope/9424)v0.1.9: 自定义 make:model 和 make:enum 命令使用的 stub 模板，适量减少重复性的工作

功能
--

[](#功能)

在 [laravel/laravel:7.x](https://github.com/laravel/laravel/tree/7.x) 的基础上增加以下功能

- 增加 DB\_PREFIX 环境变量
- 引入 sql-logger, 并配置专用的 log channel
- 引入 ide-helper 并调整配置
- 配置 php-cs-fixer 和 composer-git-hooks
- 简化 .env.example（只保留必要的项）
- 增加 scratch.php 文件模板，用于快速启动 laravel 并执行一段代码
- 定义 BaseModel , 继承后自动实现日期序列化和fillable字段定义，并自定义 make:model 模板，默认继承BaseModel
- 集成 bensampo/laravel-enum，并自定义 make:enum 模板，默认继承 LocalizedEnum 接口，重写 toArray 方法
- composer 使用阿里云的镜像源

使用
--

[](#使用)

### 使用composer create-project 创建项目

[](#使用composer-create-project-创建项目)

```
composer create-project --prefer-dist vinlon/laravel-skeleton {:project-name}
```

执行 `php init`, 然后按提示进行操作，对项目进行初始化

### 日期格式

[](#日期格式)

从 laravel 7 开始，调用 Eloquent Model 的 toArray方法，日期字段的输出格式为 `2020-12-10T09:28:59.000000Z`

可通过在 Model 中 `use SerializeDateTrait;`

```
class User extends Model
{
    use SerializeDateTrait;
}
```

或 extend BaseModel

```
class User extends BaseModel
{
}
```

将日期输出格式修改为 `2020-12-10 09:28:59`

### IDE-Helper

[](#ide-helper)

目前只用到了 ide-helper-models, 使用 @mixin 方式，对 Model 类的影响最小，将变化集中到 \_ide\_helper\_models.php 文件中

可使用如下命令生成 \_ide\_helper\_models.php 文件

```
php artisan ide-helper:models -M
```

或者使用 composer 命令

```
composer ide-helper
```

### 代码格式化

[](#代码格式化)

#### 手动执行

[](#手动执行)

```
# 检查需要格式化的内容，但不执行
composer check-style

# 格式化代码
composer fix-style
```

#### 使用 git-hook 在提交代码时自动执行

[](#使用-git-hook-在提交代码时自动执行)

在 composer.json 文件中，为 pre-commit 和 pre-push 事件定义了 git-hook.

1. pre-commit: 在 commit 代码前会调用 fix-staged-php-files 脚本，该脚本会修复所有待提交文件的格式。
2. pre-push: 在 push 代码前会检查所有 php 文件，如果有需要格式化的文件则 push 失败， 此时需要手动执行 composer fix-style, 然后 commit 格式化后的代码，再重新 push。

### Enum的使用

[](#enum的使用)

#### 常用功能

[](#常用功能)

[创建Enum类](https://github.com/BenSampo/laravel-enum#enum-definition)
[Eloquent Model 属性转换](https://github.com/BenSampo/laravel-enum#attribute-casting)
[自定义 $model-&gt;toArray() 的行为](https://github.com/BenSampo/laravel-enum#customising-model-toarray-behaviour)
[数据验证](https://github.com/BenSampo/laravel-enum#pipe-validation)
[定义 description 属性](https://github.com/BenSampo/laravel-enum#enum-descriptions)
[常用静态方法](https://github.com/BenSampo/laravel-enum#enum-class-reference)

#### 生成注解

[](#生成注解)

```
# 使用 artisan 命令为 enum 类生成注解
php artisan enum:annotate

# 使用 composer 自定义命令同时为 model 类和 enum 类生成注解
composer ide-helper
```

参考
--

[](#参考)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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

Every ~10 days

Recently: every ~16 days

Total

19

Last Release

1827d ago

PHP version history (2 changes)0.1.0PHP ^7.2.5|^8.0

0.2.0PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/277ca050c3c4260b26cadec49dafbaa2ff68d1487901ee3be0f930ad890b4d1e?d=identicon)[vinlon](/maintainers/vinlon)

---

Top Contributors

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

---

Tags

frameworklaravelSkeleton

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/vinlon-laravel-skeleton/health.svg)

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

###  Alternatives

[laravel/laravel

The skeleton application for the Laravel framework.

84.5k62.4M1.0k](/packages/laravel-laravel)[unopim/unopim

UnoPim Laravel PIM

10.3k2.2k](/packages/unopim-unopim)[bagisto/bagisto

Bagisto Laravel E-Commerce

27.4k169.0k9](/packages/bagisto-bagisto)[krayin/laravel-crm

Krayin CRM

22.6k33.4k1](/packages/krayin-laravel-crm)[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3861.7k](/packages/codewithdennis-larament)

PHPackages © 2026

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