codingyu / laravel-goto-view

vscode extension
MIT License
46 stars 28 forks source link

Support for Laravel Modules #6

Closed juanpaulo10 closed 6 years ago

juanpaulo10 commented 6 years ago

Good Day, I find that your extension is so useful when developing on my laravel projects. However, I would like to suggest to add support for laravel-modules package wherein it uses view('module_name::layout.master') naming convention in the view facade.

This would be nice especially for developing larger projects. Thank you :)

codingyu commented 6 years ago

👌 I'll try.

piperone commented 6 years ago

It is important to understand that this isn't exactly a laravel-modules specific feature. Rather, it is built right into Laravel. Doing the following in e.g. a service provider, will yield the same results:

class MyServiceProvider extends ServiceProvider
{
    public function boot()
    {
        // Load translations from here using the 'foo'-prefix
        $this->loadViewsFrom('/path/to/the/views, 'foo');
    }
}

From here, I can do view('foo:blog.index) and the foo:: part is computed to the directory I specified in MyServiceProvider. That is, Laravel will look for the file /path/to/the/views/blog/index.blade.php

I'm assuming this is what laravel-modules uses behind the scenes as well.

codingyu commented 6 years ago

Welcome to the new version. Just to find the Modules folder. 😂

anburocky3 commented 5 years ago

Documentation on How to use it on laravel modules project would be great. I couldn't find it.