Looking to hire Laravel developers? Try LaraJobs

laravel-eloquent-table-name-trait maintained by grungestranger

Description
Eloquent trait to get the names of tables of your models statically.
Last update
2019/10/17 11:10 (dev-master)
License
Links
Downloads
12 944

Comments
comments powered by Disqus

grungestranger/laravel-eloquent-table-name-trait

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.