agence-raid/sulu-site-configuration-bundle
config() system may offer more flexibility for non-Sulu projects.site_config()) and PHP services, which mirror Laravel’s Blade/Service Container patterns but require Sulu’s dependency injection (Symfony-based).sulu/sulu, symfony/uid), making it non-portable to vanilla Laravel. A wrapper layer would be needed to abstract Sulu-specific services (e.g., WebspaceResolver, MediaService).config/forms/webspace_configs/*.xml) is Sulu-specific. Laravel’s Form Requests or Spatie Laravel Forms would need to be adapted or replaced.SiteConfigurationService would need adaptation to work with Laravel’s config() or a custom multi-tenant/locale store.single_media_selection field type depends on Sulu’s media system. Replacing this with Laravel’s filesystem or Vapor/AWS would require custom field types.SiteConfigurationService) to work with Laravel’s ecosystem.SiteConfig) or Doctrine entities (requiring Symfony’s ORM)?single_media_selection fields be replaced? Options:
Route::prefix() or middleware.symfony/uid, doctrine/orm, etc.SiteConfig) with JSON column.
Schema::create('site_configs', function (Blueprint $table) {
$table->id();
$table->string('webspace_key');
$table->string('locale');
$table->json('config');
$table->timestamps();
});
symfony/orm-pack.SiteConfigurationService:
class LaravelSiteConfigService {
public function get(string $webspace, string $locale, string $key, $default = null) {
return SiteConfig::where('webspace_key', $webspace)
->where('locale', $locale)
->value('config->'.$key) ?? $default;
}
}
namespace App\Forms;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
class SiteConfigForm extends Form {
public function form() {
return [
TextInput::make('website_email')
->label('Email')
->required(),
];
}
}
site_config() helper with a custom Twig extension:
// app/Providers/AppServiceProvider.php
public function register() {
Twig::getInstance()->addFunction(new \Twig\TwigFunction(
'site_config',
[$this->app->make(LaravelSiteConfigService::class), 'get']
));
}
| Component | Sulu Bundle | Laravel Equivalent | Compatibility Risk |
|---|---|---|---|
| ORM | Doctrine | Eloquent | High (schema/migration conflicts) |
| Admin UI | Sulu’s admin panel | Nova/Filament | High (UI/UX redesign needed) |
| Media Handling | Sulu MediaService | Spatie Media Library | Medium (custom field types required) |
| Routing | Sulu’s admin routes | Laravel routes/middleware | Low (easy to rewrite) |
| Configuration | JSON entity in Doctrine | Eloquent JSON column or cache | Medium (query differences) |
| Localization | Sulu’s locale/webspace system | Laravel locales + custom middleware | High (multi-tenancy not native) |
SiteConfigurationService and Twig integration.SiteConfigurationService into a Laravel-compatible layer.How can I help you explore Laravel packages today?