use Illuminate\Filesystem\Filesystem;
use Livewire\Commands\ComponentParser;
use Livewire\LivewireComponentsFinder;
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Relations\Relation;
use App\Base\Utilities\ExtendedLivewireComponentsFinder;
class AppServiceProvider extends ServiceProvider
{
//
public function register()
{
$this->app->singleton(LivewireComponentsFinder::class, function () {
return new ExtendedLivewireComponentsFinder(
new Filesystem,
config('livewire.manifest_path') ?: app()->bootstrapPath('cache/livewire-components.php'),
collect(config('livewire.class_namespaces'))->map(function ($item) {
return ComponentParser::generatePathFromNamespace($item);
})
);
});
//
}
}