grungestranger/laravel-eloquent-table-name-trait

Eloquent trait to get the names of tables of your models statically.

Installs: 11 936

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/grungestranger/laravel-eloquent-table-name-trait

v1.0.0 2019-10-17 09:10 UTC

This package is auto-updated.

Last update: 2025-10-17 22:42:56 UTC


README

Provides an Eloquent trait to get the names of tables of your models statically.

Requirements

  • This package requires PHP 7.1+
  • It works with Laravel >=4.2

Installation

Require this package with composer

composer require grungestranger/laravel-eloquent-table-name-trait

Load the trait in your Model.

use Grungestranger\TableName\TableName;

class Example extends Model {

    use TableName;
}

To get the name of the table, use the static getTableName method:

Example::getTableName();

License

This open-source software is licensed under the MIT license.