diplodocker / comments-loader
Laravel table comments loader (part of Diplodocker project)
Fund package maintenance!
Patreon
Installs: 5 749
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: ^7.1.3
Requires (Dev)
- slevomat/coding-standard: dev-master
This package is auto-updated.
Last update: 2025-03-11 19:14:01 UTC
README
Why should I use a package?
Install
- Install laravel =)
composer require --dev diplodocker/comments-loader
Lumen provider setup
bootstrap/app.php
$app->register(Diplodocker\Providers\CommentsLoaderProvider::class);
Usage in migration (MySQL or Postgres)
/** * Run the migrations. * * @return void */ public function up() { Schema::create('test', function (Blueprint $table) { $table->bigIncrements('id'); $table->nullableTimestamps(); $table->tableComment('its sample table comment'); }); // or change on existing table Schema::table('test', function(Blueprint $table) { $table->tableComment('its changed comment'); }); }
Or use class (only for MySQL)
<?php use Diplodocker\CommentsLoaderMigration; class SomeMigrationFileName extends CommentsLoaderMigration { public $comments = [ 'users' => 'Users table', 'documents' => 'Documents table', ... ];
Or use trait
<?php use Diplodocker\Concerns\CommentsLoader; use Illuminate\Database\Migrations\Migration; class SomeMigrationFileName extends Migration { // use trait use CommentsLoader; public $comments = [ 'users' => 'Users table', 'documents' => 'Documents table', ... ]; /** * Run the migrations. * * @return void */ public function up() { // your code here $this->loadTableComments(); } /** * Reverse the migrations. * * @return void */ public function down() { // your code here }