devjoghurt/hof-plexexport-bundle
AppKernel.php), which Laravel’s service container and routing system does not natively support. A Laravel-specific adapter would need to:
ContainerAware services with Laravel’s ServiceProvider/Binding system.config/app.php or a custom ServiceProvider.plex_movies.html.twig), which Laravel supports but requires explicit configuration (e.g., via Blade or a Twig bridge like laravel-twig).Kernel, Bundle inheritance) make direct adoption in Laravel non-trivial. Key hurdles:
routing.yml vs. Laravel’s routes/web.php.config.yml) vs. Laravel’s PHP/ENV-based config.ContainerInterface vs. Laravel’s Container/ServiceProvider.Illuminate\Support\ServiceProvider).AppKernel → AppServiceProvider).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Symfony-Specific Code | High | Refactor or replace Symfony dependencies. |
| Twig Template Binding | Medium | Use Laravel-Twig bridge or convert to Blade. |
| Configuration Override | Medium | Abstract YAML config into Laravel’s config/plex.php. |
| Plex API Dependency | Low | Test with local Plex instance before production. |
| Bundle Registration | High | Implement custom ServiceProvider for bundle-like behavior. |
Controller or Laravel’s Route?laravel-twig).config/plex.php (replace YAML).Route::get('/plex-export', ...).ServiceProvider or PackageServiceProvider.Option A: Direct Library Integration (Low Effort)
composer require dachande663/plex-export.ServiceProvider to wrap the library.// app/Providers/PlexExportServiceProvider.php
use Dachande663\PlexExport\PlexExport;
class PlexExportServiceProvider extends ServiceProvider {
public function register() {
$this->app->singleton(PlexExport::class, function ($app) {
return new PlexExport([
'plex_url' => config('plex.url'),
'data_dir' => storage_path('plex-exports'),
]);
});
}
}
Option B: Laravel Bundle Wrapper (Medium Effort)
Bundle with ServiceProvider.config/plex.php./packages/laravel-plexexport/
├── src/
│ ├── ServiceProvider.php
│ ├── PlexExportFacade.php
│ ├── Views/ (Blade/Twig templates)
├── config/plex.php
├── routes/web.php
Option C: Hybrid Approach (High Effort)
| Component | Symfony Bundle | Laravel Adaptation |
|---|---|---|
| Bundle Registration | AppKernel |
ServiceProvider |
| Configuration | YAML (config.yml) |
PHP (config/plex.php) |
| Templates | Twig | Blade or Twig (bridge) |
| Routing | Symfony Router | Laravel Router |
| Service Container | Symfony DI | Laravel Container |
Phase 1: Proof of Concept (1-2 days)
Phase 2: Configuration Abstraction (1 day)
config/plex.php.// config/plex.php
return [
'plex_url' => env('PLEX_URL', 'http://localhost:32400'),
'data_dir' => storage_path('plex-exports'),
'thumbnail_width' => 150,
'sections' => ['movies', 'shows'],
];
Phase 3: Template Integration (1 day)
laravel-twig.resources/views/plex/export.blade.php):
@foreach($plexExport->getMovies() as $movie)
<div>
<img src="{{ $movie->getThumbnailUrl() }}" width="150">
<h3>{{ $movie->getTitle() }}</h3>
</div>
@endforeach
Phase 4: Routing & API (1 day)
Route::get('/plex-export', [PlexExportController::class, 'index']);
class PlexExportController extends Controller {
public function index(PlexExport $plexExport) {
return view('plex/export', [
'plexExport' => $plexExport->export(),
]);
}
}
Phase 5: Testing & Optimization (2-3 days)
cache()->remember).tightenco/laravel-twig.Bundle not found) wouldHow can I help you explore Laravel packages today?