Created
April 17, 2018 09:44
-
-
Save mykeels/df13807cf105d0f92d6d4eaa3fa22d5b to your computer and use it in GitHub Desktop.
A trait that adds a static `name()` method to Laravel Models
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Traits; | |
| trait ModelTableNameTrait | |
| { | |
| public static function name() { | |
| return with(new static)->getTable(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment