diff --git a/src/FrameworkServiceProvider.php b/src/FrameworkServiceProvider.php index 98fb662a..c4789634 100644 --- a/src/FrameworkServiceProvider.php +++ b/src/FrameworkServiceProvider.php @@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Blade; use Illuminate\Support\ServiceProvider; -use Notfound\Framework\View\Components\Forms\Form; +use NotFound\Framework\View\Components\Forms\Form; class FrameworkServiceProvider extends ServiceProvider { @@ -27,10 +27,6 @@ public function boot(): void __DIR__.'/Providers/AuthServiceProvider.php' => app_path('Providers/AuthServiceProvider.php'), __DIR__.'/../database/seeders/DatabaseSeeder.php' => database_path('seeders/DatabaseSeeder.php'), ], 'siteboss-framework'); - - Blade::component('formbuilder-form', Form::class); - Blade::componentNamespace('NotFound\\Framework\\View\\Components\\Forms\\Fields', 'fields'); - } public function register(): void diff --git a/src/Services/Forms/Fields/FactoryType.php b/src/Services/Forms/Fields/FactoryType.php index 584e3d9a..50c32c20 100644 --- a/src/Services/Forms/Fields/FactoryType.php +++ b/src/Services/Forms/Fields/FactoryType.php @@ -32,6 +32,11 @@ function customclassPath(string $className): string spl_autoload_register(function ($className) { $defaultFieldsPath = app_path().'/Services/Forms/Fields/'; + // TODO: BUG: This is not working + // Quick fix for now, but we need to understand what this does + // and preferably have it adhere to PSR-4. + $sitebossFieldsPath = app_path().'app/Services/Forms/Fields/'; + if (startsWithAndStrip($className, 'NotFound\\Framework\\Services\\Forms\\Fields\\') || startsWithAndStrip($className, 'App\\Services\\Forms\\Fields\\')) { // Check if siteboss has a field type $completeClassName = $sitebossFieldsPath.customclassPath($className);