yannoff/lumiere-utils

A set of utils & helpers for Laravel

0.2.0 2021-12-11 17:16 UTC

This package is auto-updated.

Last update: 2024-12-12 00:26:26 UTC


README

A set of utils & helpers for Laravel.

Installation

composer require yannoff/lumiere-utils

Reference

Utils\Database\BluePrintUtils::addTimestamps()

Synopsis

BluePrintUtils::addTimestamps(Blueprint $table, int $precision = 0)

Add created_at & updated_at columns with DEFAULT CURRENT_TIMESTAMP to the blueprint

Example

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

use Yannoff\Lumiere\Utils\Database\BluePrintUtils;

class CreateTagsTable extends Migration
{
    /**
     * @return void
     */
    public function up()
    {
        Schema::create('tags', function (Blueprint $table) {
            $table->id();
            $table->string('label', 120);
            $table->string('slug', 128);
            BluePrintUtils::addTimestamps($table);
        });
    }
}

License

Licensed under the MIT License.