Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to configure for Laravel Blade views? #120

Open
tristanjahier opened this issue Nov 21, 2024 · 5 comments
Open

How to configure for Laravel Blade views? #120

tristanjahier opened this issue Nov 21, 2024 · 5 comments

Comments

@tristanjahier
Copy link

tristanjahier commented Nov 21, 2024

Hello,

I was recently wondering if we could make this awesome tool work in Laravel Blade files (*.blade.php).
Currently it does not work.

It would come in especially handy when working with Livewire and its package Volt, because you have to write plain PHP logic inside of views, on top of HTML. See: https://livewire.laravel.com/docs/volt.

I have tried to add this to my personal LSP-intelephense settings:

"settings": {
    "intelephense": {
        "files": {
            "associations": [
                "*.php",
                "*.phtml",
                "*.blade.php"
            ]
        }
    }
}

but it does not work.

I have also tried forcing the syntax to "PHP" rather than "HTML (Blade)", and it works. But then I lose all my syntax highlighting for Blade.

So, it seems to be working fine if Intelephense thinks the Blade files are just PHP files. What can we do?

@jfcherng
Copy link
Collaborator

@tristanjahier
Copy link
Author

Hello @jfcherng! Thank you for your response. Yes I am using that package. But it does not work with:

"selector": "embedding.php | text.html.blade",

The latter link is related to the VSCode plugin, I am not sure the info transfers to ST.

@jfcherng
Copy link
Collaborator

jfcherng commented Nov 23, 2024

Then I am afraid that I can help since I have not dev in php for years. The later link is the server used by this plugin.

@tristanjahier
Copy link
Author

OK, thank you anyway!

@itsmewes
Copy link

I'm not sure if this is what you are looking for (I don't use Volt) but I use the Laravel Goto package to jump to blade and lang files. Might work for your use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants