diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index 0e0c6f933e5b..9098616dc4d7 100644 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -1155,7 +1155,9 @@ public static function unsetConnectionResolver() public function getTable() { if (! isset($this->table)) { - return str_replace('\\', '', Str::snake(Str::plural(class_basename($this)))); + $this->setTable(str_replace( + '\\', '', Str::snake(Str::plural(class_basename($this))) + )); } return $this->table;