Anonymous Blade Components in Laravel Packages
During package development you may want to register a anonymous Blade component, instead of going the long way by creating a class you can do this:
/**
* Bootstrap your package's services.
*/
public function boot()
{
// First register your views directory of my-package
$this->loadViewsFrom('resources/views', 'pages');
// Laravel will automagically find all components
// in "resources/views" directory
Blade::component('my-package::master', 'master');
Blade::component('my-package::app', 'app');
}
However, if you find a way to load the components from a sub-folder in this way, let me know!