contao/news-bundle
Adds full news management to the Contao CMS: create and organize news archives and items, publish and list news on your site, and integrate news features into a professional, easy-to-maintain Contao installation.
Contao-Specific Constraints: The news-bundle is tightly coupled with Contao CMS, which uses Doctrine 1.x, Smarty templating, and a legacy DCA (Data Container API) system. Laravel’s Eloquent ORM, Blade templating, and resource-based admin (e.g., Nova/Livewire) introduce fundamental architectural mismatches.
tl_* database tables (e.g., tl_news, tl_news_archive) are schema-first with no migrations, conflicting with Laravel’s migration-first approach.@Route) differs from Laravel’s declarative routes.Laravel Integration Points:
HttpKernel, DependencyInjection), which are natively supported in Laravel but require manual configuration (e.g., service providers).Contao\CoreBundle and Contao\ManagerPlugin systems.tl_news, tl_news_archive) with hardcoded queries.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Database Schema Mismatch | High | Rewrite Contao’s tl_news schema as Laravel migrations or use a schema tool (e.g., spatie/laravel-schema). |
| Admin UI Rebuild | High | Replace Contao’s DCA backend with Livewire or Nova, requiring ~2-3 weeks of dev effort. |
| Templating Incompatibility | High | Convert Smarty templates to Blade or use a Twig adapter (e.g., symfony/twig-bridge). |
| Dependency Conflicts | Medium | Use Composer’s replace or alias Contao-specific packages (e.g., contao/core-bundle). |
| Routing Conflicts | Medium | Rewrite Contao’s annotation-based routes to Laravel’s declarative syntax. |
| Performance Overhead | Low | Benchmark Contao’s N+1 queries vs. Laravel’s Eloquent eager loading. |
Business Goals:
Technical Scope:
contao/calendar-bundle) also be integrated?Migration Strategy:
Team Constraints:
tl_* tables) or Laravel admin UI experience (Livewire/Nova)?Alternatives:
| Contao Component | Laravel Equivalent | Notes |
|---|---|---|
| Doctrine 1.x | Eloquent (Doctrine 2.x) or DBAL | Rewrite schema migrations; avoid tl_* table names if possible. |
| Smarty Templating | Blade or Twig | Use Blade directives for dynamic Contao logic (e.g., @if($news->published). |
| Contao CoreBundle | Laravel Service Providers | Replace Contao\ManagerPlugin with Illuminate\Support\ServiceProvider. |
tl_* Database Tables |
Laravel Migrations | Use php artisan make:migration for Contao tables or schema tools. |
| DCA (Admin UI) | Livewire or Nova Resources | Rebuild forms using Livewire or Nova’s CRUD. |
| Routing | Laravel Router | Replace @Route annotations with Route::get() in routes/web.php. |
| News Modules (Frontend) | Laravel Views + API Resources | Convert NewsList/NewsReader modules to Blade components. |
Audit Contao Dependencies:
NewsModel, ArchiveModel) vs. Contao-specific helpers.getPublishedNews() from Contao\NewsBundle\Model\NewsModel to a Laravel service.Rebuild Database Schema:
tl_news and tl_news_archive:
php artisan make:migration create_news_tables
Schema::create('news', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->text('teaser')->nullable();
$table->text('content');
$table->boolean('published')->default(false);
$table->timestamps();
});
Replace Templating:
news_list.html5) to Blade:
<!-- resources/views/news/list.blade.php -->
@foreach($newsItems as $news)
<article>
<h2>{{ $news->title }}</h2>
<div>{!! $news->content !!}</div>
</article>
@endforeach
Admin UI Rebuild:
// app/Livewire/NewsManager.php
public function updateNews($id, array $data)
{
$news = News::findOrFail($id);
$news->update($data);
}
// app/Nova/News.php
public static $title = 'title';
public static $search = ['title', 'content'];
Routing:
// routes/web.php
Route::get('/news/{id}', [NewsController::class, 'show']);
Route::get('/news', [NewsController::class, 'index'])->name('news.index');
Testing:
test('news can be published', function () {
How can I help you explore Laravel packages today?