定制 esign/laravel-auto-timestamps 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

esign/laravel-auto-timestamps

最新稳定版本:1.0.0

Composer 安装命令:

composer require esign/laravel-auto-timestamps

包简介

Adds ON UPDATE CURRENT_TIMESTAMP support for MySQLGrammar

README 文档

README

THIS PACKAGE IS NOT MAINTAINED ANYMORE

useCurrentOnUpdate has been pr'd into the framework itself:

$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();

Laravel Auto Timestamps

This package adds the ability to use auto-updating timestamps for MySQL databases.

Installation

You can install the package via composer:

composer require esign/laravel-auto-timestamps

If you want to define the database connections on which the migration helpers should be available, you could publish the config file:

php artisan vendor:publish --provider="Esign\AutoTimestamps\AutoTimestampsServiceProvider"

Usage

Specifying database connections

To specify the database connections on which the migrations should be available, edit the connections array in the config file. The mysql connection is used by default.

'connections' => [
    'mysql',
],

Migrations

This package provides a ->useCurrentUpdate() method on the blueprint class, which only triggers when running against a MySQL database.

A blueprint macro ->autoTimestamps() is included that will allow you to quickly set up auto-updating created_at and updated_at timestamps. You may edit the name of this macro in the config file.

$table->autoTimestamps();

// results in:
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrentUpdate();

统计信息

  • 总下载量: 5.38k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-14