Skip to content

Commit

Permalink
fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
d8vjork committed Aug 16, 2024
1 parent 44717c0 commit 2d20a2e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
class Helpers
{
/**
* Get model from class or string (by name).
*
* @return \Illuminate\Database\Eloquent\Model|class-string<\Illuminate\Database\Eloquent\Model>|null
*/
* Get model from class or string (by name).
*
* @return \Illuminate\Database\Eloquent\Model|class-string<\Illuminate\Database\Eloquent\Model>|null
*/
public static function modelFrom(string $value, bool $asClass = true, string $namespace = 'App\Models\\')
{
$value = implode(
Expand Down Expand Up @@ -55,7 +55,6 @@ public static function isModel(mixed $class): bool
&& $classReflection->isSubclassOf('Illuminate\Database\Eloquent\Model');
}


/**
* Get model instance from a mix-typed parameter.
*
Expand All @@ -70,7 +69,7 @@ public static function isModel(mixed $class): bool
public static function instanceFrom(mixed $key, string $class, array $columns = ['*'], array $with = [], bool $enforce = false)
{
if (! \class_exists($class) || ! static::isModel($class) || (\is_object($key) && ! static::isModel($key))) {
throw (new ModelNotFoundException())->setModel($class);
throw (new ModelNotFoundException)->setModel($class);
}

if (static::isModel($key) && $enforce) {
Expand Down

0 comments on commit 2d20a2e

Please sign in to comment.