Skip to content

Commit

Permalink
Update variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
natanfelles committed Nov 7, 2022
1 parent 42c67d1 commit 9b8661a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Model.php
Expand Up @@ -191,15 +191,15 @@ protected function getTable() : string

protected function makeTableName() : string
{
$class = static::class;
$pos = \strrpos($class, '\\');
$name = static::class;
$pos = \strrpos($name, '\\');
if ($pos) {
$class = \substr($class, $pos + 1);
$name = \substr($name, $pos + 1);
}
if (\str_ends_with($class, 'Model')) {
$class = \substr($class, 0, -5);
if (\str_ends_with($name, 'Model')) {
$name = \substr($name, 0, -5);
}
return $class;
return $name;
}

#[Pure]
Expand Down

0 comments on commit 9b8661a

Please sign in to comment.