Skip to content

Commit cbcd568

Browse files
committed
fixed docblock method name
1 parent 84be2c6 commit cbcd568

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

resources/docblock.blade.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**{!! when(!str_contains($controller, '\\Closure'), "\n * @see {$controller}::{$method}") !!}
1+
/**{!! when(!str_contains($controller, '\\Closure'), PHP_EOL . " * @see {$controller}::" . ($isInvokable ? '__invoke' : $docblock_method ?? $method)) !!}
22
* @see {!! $path !!}:{!! $line !!}
33
@foreach ($parameters as $parameter)
44
@if ($parameter->default !== null)

resources/multi-method.blade.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
@use('Illuminate\Support\HtmlString')
2-
31
@foreach ($routes as $route)
4-
@include('wayfinder::method', [
5-
...$route,
6-
'method' => $route['tempMethod'],
7-
'export' => false,
8-
])
2+
@include('wayfinder::method', [
3+
...$route,
4+
'method' => $route['tempMethod'],
5+
'docblock_method' => $route['method'],
6+
'export' => false,
7+
])
98
@endforeach
9+
1010
{!! when(!$isInvokable, 'export ') !!}const {!! $method !!} = {
1111
@foreach ($routes as $route)
1212
@js($route['uri']): {!! $route['tempMethod'] !!},
1313
@endforeach
14-
}{{"\n"}}
14+
}{{PHP_EOL}}

src/GenerateCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ private function writeMultiRouteControllerMethodExport(Collection $routes, strin
170170
'isInvokable' => $routes->first()->hasInvokableController(),
171171
'withForm' => $this->option('with-form') ?? false,
172172
'routes' => $routes->map(fn ($r) => [
173+
'method' => $r->jsMethod(),
173174
'tempMethod' => $r->jsMethod().md5($r->uri()),
174175
'parameters' => $r->parameters(),
175176
'verbs' => $r->verbs(),

0 commit comments

Comments
 (0)