Skip to content

Commit

Permalink
fix missing route path & name
Browse files Browse the repository at this point in the history
  • Loading branch information
joesama committed Oct 29, 2019
1 parent 2a988b1 commit 2419d97
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Routings/Concerns/Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ public function pathConvention(string $type, string $function, array $attributes
*/
private function keymapIsString($keymap): array
{
if (\is_string($keymap) && Str::length($keymap) > 0) {
return [$keymap];
if (\is_string($keymap)) {
return (Str::length($keymap) > 0) ? Arr::wrap($keymap) : [];
}

return [];
return $keymap;
}

/**
Expand Down Expand Up @@ -111,6 +111,10 @@ public function namedConvention(string $type, string $controller, string $functi

$names = array_change_key_case($named, \CASE_LOWER);

return Str::lower(collect($names)->get($type)) ?? Str::lower($type . '.' . $controller . '.' . $function);
if (collect($names)->has($type)) {
return Str::lower(collect($names)->get($type, \null));
} else {
return Str::lower($type . '.' . $controller . '.' . $function);
}
}
}

0 comments on commit 2419d97

Please sign in to comment.