Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Mar 7, 2024
1 parent 7f13126 commit 7e43007
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Fields/Relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ abstract class Relation extends Field implements Form
/**
* The route key resolver.
*/
protected ?Closure $routeKeyNameResovler = null;
protected ?Closure $routeKeyNameResolver = null;

/**
* Create a new relation field instance.
Expand Down Expand Up @@ -173,7 +173,7 @@ public function getUriKey(): string
*/
public function resolveRouteKeyNameUsing(Closure $callback): static
{
$this->routeKeyNameResovler = $callback;
$this->routeKeyNameResolver = $callback;

return $this;
}
Expand All @@ -183,11 +183,11 @@ public function resolveRouteKeyNameUsing(Closure $callback): static
*/
public function getRouteKeyName(): string
{
$callback = is_null($this->routeKeyNameResovler)
$callback = is_null($this->routeKeyNameResolver)
? function (): string {
return Str::of($this->getRelationName())->singular()->ucfirst()->prepend('relation')->value();
}
: $this->routeKeyNameResovler;
: $this->routeKeyNameResolver;

return call_user_func($callback);
}
Expand Down

0 comments on commit 7e43007

Please sign in to comment.