grungestranger/laravel-eloquent-table-name-trait

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

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

This package is auto-updated.

Last update: 2025-04-17 21:25:26 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.