laravel-goto-view icon indicating copy to clipboard operation
laravel-goto-view copied to clipboard

Support for anonymous component paths.

Open Waghabond opened this issue 1 year ago • 2 comments

The extension should look in service providers' boot() methods for Blade::anonymousComponentPath() calls and highlight component tags accordingly

// app/Providers/AppServiceProvider.php
public function boot()
{
    Blade::anonymousComponentPath(resource_path('views/layouts'), 'layouts');
}
{{-- resources/views/layouts/app.blade.php --}}
<html>
    <head></head>
    <body>{{ $slot }}</body>
</html>

The following should now be clickable:

{{-- resources/views/home.blade.php --}}
<x-layouts::app>
    {{-- content --}}
</x-layouts::app>

Waghabond avatar Mar 30 '23 08:03 Waghabond

This may require some configuration, because this extension does not run php to find the view path.

codingyu avatar Apr 13 '23 03:04 codingyu

A setting that can map anonymous component paths in the extension's configuration would be perfectly sufficient! (at least for my use case. If it could happen "automagically" that would of course be even better)

Waghabond avatar Apr 20 '23 03:04 Waghabond