<?php
public function boot()
{
$dir = resource_path(<views-folder>);
$this->loadViewsFrom($dir, '<prefix>');
foreach (scandir($dir) as $file) {
if(str_contains($file, ".blade")) {
$component = str_replace(".blade.php", "", $file);
Blade::component("package-name::$component", $component, '<component-prefix>');
}
}
}
Last active
June 11, 2021 05:00
-
-
Save jjcodes78/1e1916d4aa9d77f43fafb4a5b5462f1a to your computer and use it in GitHub Desktop.
Registering anonymous blade components from a package
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment