acseo/base-rest-bundle
Symfony bundle providing a base REST layer you can extend to expose your entities. Designed as a starting point for building REST APIs with reusable controllers/services; install via Composer and enable the bundle in your kernel.
FrameworkBundle, HttpFoundation).EventDispatcher, Serializer).symfony/var-dumper).| Component | Compatibility | Workarounds Needed |
|---|---|---|
| Symfony Bundle | ❌ No (Laravel native) | Use Symfony Bridge or rewrite as Laravel package. |
| Doctrine ORM | ⚠️ Partial (Laravel uses Eloquent) | Adapt to Eloquent or use Doctrine DBAL. |
| Routing | ❌ Symfony’s routing.yml |
Replace with Laravel’s Route::resource(). |
| Validation | ⚠️ Symfony Validator | Use Laravel’s FormRequest or rewrite rules. |
| Serialization | ❌ Symfony Serializer | Use Laravel’s JsonResource or Fractal. |
| Dependency Injection | ❌ Symfony DI Container | Bind services manually or use Laravel’s IoC. |
ACSEOBaseRestController) as a Laravel package.// Replace Symfony Controller with Laravel-style
class BaseRestController extends Controller {
use AuthorizesRequests, ValidatesRequests;
public function index() {
return response()->json(Entity::all());
}
}
User) to test integration.symfony/http-foundation and symfony/routing as Laravel dependencies for minimal compatibility.ContainerAwareTrait won’t work; use Laravel’s middleware binding.ACSEOBaseRestBundle must be rewritten as a Laravel ServiceProvider.config.yml → Laravel’s config/rest.php.GET /users, POST /users).EventDispatcher) if used./v1/users, /v2/users).EventDispatcher could add latency.HttpCache) may need adaptation.throttle middleware.| Risk | Impact | Mitigation |
|---|---|---|
| Bundle breaks on PHP 8.x | API endpoints fail silently. | Pin to PHP 7.4 in composer.json or fork. |
| Symfony-Laravel conflicts | Dependency collisions (e.g., monolog). |
Use replace in composer.json or aliases. |
| Poor error handling | 500 errors for invalid requests. | Override bundle’s exception handling. |
| Security gaps | Missing CSRF/auth checks. | Layer Laravel’s VerifyCsrfToken middleware. |
| No monitoring | Undetected performance regressions. | Add Laravel Telescope or Prometheus metrics. |
ACSEOBaseRestBundle’s conventions.How can I help you explore Laravel packages today?