mcmatters/laravel-nullable-attribute

此包已废弃且不再维护。未建议替代包。

Laravel nullable attributes

v1.2 2023-11-09 17:24 UTC

This package is auto-updated.

Last update: 2023-11-09 17:25:38 UTC


README

自动生成并填充数据库列作为可空值的包。

安装

composer require mcmatters/laravel-nullable-attributes

如果你使用 Laravel 5.5 或更高版本,可以跳过此步骤。

config/app.php 文件中包含服务提供者。

'providers' => [
    McMatters\NullableAttributes\ServiceProvider::class,
]

发布配置。

php artisan vendor:publish --provider="McMatters\NullableAttributes\ServiceProvider"

然后打开 config/nullable-attributes.php 并配置模型所在路径。

要求

此包需要 php 7.0 或更高版本,以及 Laravel 5.2 或更高版本。它已在 Laravel 5.2 及更高版本上进行了测试。

使用方法

每次重建数据库模式时,都需要运行命令 php artisan nullable-attributes:cache