austral/entity-translate-bundle
Translatable interfaces, Translate objects). Laravel’s Eloquent ORM would require custom adapters or abstraction layers to map Doctrine behaviors to Eloquent.spatie/laravel-translatable, laravel-localization) for this, making this bundle a redundant or niche fit unless Symfony-specific features (e.g., HttpRequest integration in Doctrine listeners) are critical.doctrine/orm + doctrine/dbal for Laravel via spatie/laravel-doctrine or custom setup).translate join tables).HttpRequest in Doctrine listeners are Symfony-container dependent. Laravel’s Http or Request services would need mocking or proxying.symfony/event-dispatcher) differs from Laravel’s. Custom event listeners would be needed to bridge translation lifecycle hooks.Translatable interfaces to Laravel traits).austral/tools-bundle and austral/entity-bundle (v3.1+) adds unnecessary complexity if Laravel’s native solutions suffice.fetch="EAGER" or DQL hints).spatie/laravel-translatable or custom Eloquent solutions meet needs with lower risk?spatie/laravel-doctrine) to unify translation logic, but this is overkill for most cases.spatie/laravel-translatable usage).spatie/laravel-doctrine).Product with Translatable fields) to test:
prePersist for translation mapping).spatie/laravel-translatable).| Component | Compatibility Risk | Mitigation Strategy |
|---|---|---|
| Doctrine ORM | Laravel’s Eloquent is incompatible without a bridge. | Use spatie/laravel-doctrine or build a custom Doctrine-Eloquent adapter. |
| Symfony Event Dispatcher | Laravel’s event system differs (e.g., Illuminate\Support\Facades\Event). |
Create proxy listeners to translate Symfony events to Laravel events. |
| HTTP Request Service | Symfony’s HttpRequest is not available in Laravel. |
Mock or replace with Laravel’s Request facade or a custom service. |
| Austral Bundles | austral/tools-bundle and austral/entity-bundle may pull in unused Symfony code. |
Evaluate if these dependencies are strictly necessary or can be replaced. |
| PHP 8.0+ | Laravel 9+ supports PHP 8.0+, but bundle may introduce strict typing conflicts. | Test with strict_types=1 and adjust Laravel’s config.php settings. |
translate join tables).Schema::create('translate', function (Blueprint $table) {
$table->id();
$table->string('locale');
$table->string('field'); // e.g., 'name', 'description'
$table->text('content');
$table->unsignedBigInteger('translatable_id');
$table->string('translatable_type'); // Polymorphic relation
$table->timestamps();
});
Product with Translatable trait).use Austral\EntityBundle\Interfaces\TranslatableInterface;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class Product implements TranslatableInterface
{
#[ORM\Column(type: 'string')]
private string $name;
// Getters/setters + translation methods...
}
TranslateListener) to Laravel’s container.$container->bind('austral.translate.listener', function () {
return new TranslateListener(
new DoctrineEntityManager($entityManager),
new HttpRequest() // Laravel Request facade wrapper
);
});
public function show(Product $product, string $locale)
{
return response()->json($product->getTranslation($locale));
}
austral/* dependencies may require manual patching if they diverge from Laravel’s ecosystem.How can I help you explore Laravel packages today?