TableSuffix.php 335 B

12345678910111213141516171819
  1. <?php
  2. namespace App\Modules\Book\Models;
  3. trait TableSuffix
  4. {
  5. private static $suffix;
  6. public static function suffix($suffix)
  7. {
  8. static::$suffix = $suffix;
  9. }
  10. public function __construct(array $attributes = [])
  11. {
  12. $this->table .= static::$suffix;
  13. parent::__construct($attributes);
  14. }
  15. }