Skip to content

Commit

Permalink
Change method name for resolving action classes in routes
Browse files Browse the repository at this point in the history
  • Loading branch information
CWAscend committed Oct 17, 2024
1 parent abc9728 commit b258f5c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Routing/ActionResourceRegistrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function getResourceAction($resource, $controller, $method, $options):
*
* @example
*
* ActionResourceRegistrar::resolveResourcefulActionsUsing(
* ActionResourceRegistrar::resolveActionClassNameUsing(
* function ($resource, $method): ?string {
* return ucfirst($method)
* .ucfirst(Str::camel(str_replace('.', '-', $resource)))
Expand All @@ -56,7 +56,7 @@ protected function getResourceAction($resource, $controller, $method, $options):
* @param Closure $resolver
* @return void
*/
public static function resolveResourcefulActionsUsing(Closure $resolver): void
public static function resolveActionClassNameUsing(Closure $resolver): void
{
static::$actionResolver = $resolver;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ResourcefulRouteRegistrarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
});

it('allows you to customise the name of each action class, but falls back to the default behaviour if unresolved', function () {
ActionResourceRegistrar::resolveResourcefulActionsUsing(function (string $resource, string $method) {
ActionResourceRegistrar::resolveActionClassNameUsing(function (string $resource, string $method) {
return match ($method) {
'index' => 'ShowIndexPage',
'create' => 'ShowCreatePage',
Expand Down

0 comments on commit b258f5c

Please sign in to comment.