loicpennamen/sf-shared-repository
A shared repository package for Symfony applications that provides a reusable base repository layer, centralizing common data-access logic and reducing duplication across entities while keeping persistence code consistent and maintainable. Ideal for teams seeking a clean, reusable data-access founda...
Verdict up front: this is not a Laravel package, and the mismatch is architectural rather than cosmetic. Despite being distributed as a Composer package, loicpennamen/sf-shared-repository is a Symfony 4 / Doctrine ORM component. Its stated purpose is to substitute Symfony's ServiceEntityRepository (a class shipped by doctrine/doctrine-bundle, the Symfony integration layer for Doctrine) with a variant that can interpret DataTables server-side query parameters. Any Laravel-first evaluation should treat it as out of scope for the Eloquent stack and only revisit it if the target service is a Symfony/Doctrine application.
Architecture fit (Laravel): poor.
EntityManager, DQL, and Symfony's DI container. There is no meaningful adapter path without adopting laravel-doctrine/orm and porting the ServiceEntityRepository inheritance to Laravel's container semantics — at which point you have rewritten the package.Architecture fit (Symfony/Doctrine): plausible but narrow. Extending repository classes to auto-translate DataTables request parameters into DQL is a reasonable convenience pattern, but it is a pattern, not a platform. The value is concentrated in a few hundred lines of query-building logic.
Integration feasibility: low.
ServiceEntityRepository signature is likely pinned to Doctrine ORM 2.x and PHP 7.x-era constraints, which conflicts with current Laravel (PHP 8.2+ minimum on L11/L12) and with modern Doctrine (ORM 3.x).Technical risk: high.
password_hash or another tenant's rows via an unexpected column name), and denial of service through expensive unindexed sorts and LIKE '%…%' scans.Key questions to put to the maintainer or to resolve before any POC:
composer.json constraint matrix and a CI badge?Stack fit. Assume a Laravel codebase unless proven otherwise. In that case the correct action is a no-go on adoption and a recommendation to use a native, actively maintained equivalent: yajra/laravel-datatables (or a hand-rolled QueryBuilder + LengthAwarePaginator implementation that maps validated, allowlisted request parameters onto Eloquent scopes). That delivers the same server-side DataTables capability with Eloquent idioms, first-class Laravel testing support, and a maintained security posture.
If the target is genuinely Symfony/Doctrine. Then the evaluation changes shape: the package is directionally relevant, but Symfony 4 is EOL, so the realistic path is pattern extraction, not dependency adoption — read the class, reimplement the parameter-to-DQL mapping inside your own ServiceEntityRepository subclass on a supported Symfony (6.4 LTS or 7.x) and Doctrine ORM 3, and own the code.
Migration path (if adoption is mandated). There is no incremental path from Eloquent: introducing this requires standing up a Doctrine entity layer alongside Eloquent, dual-writing or migrating schema, and accepting two persistence paradigms in one codebase. That is a multi-quarter architectural change justified by nothing this package provides. Do not sequence it as "add the package first, migrate later."
Compatibility checks to run before any code is written.
composer.json constraints against the target PHP and framework versions with composer why-not.ServiceEntityRepository signature matches the DoctrineBundle version in the target app; a version skew here produces fatal errors at container compile time, not runtime, which is at least a fast failure.search[value], order[i][column], columns[i][data]), since DataTables 1.x and 2.x differ and a Symfony 4-era package will assume 1.x.Sequencing for a bounded POC (2–3 days, timeboxed).
composer audit).sort on an unindexed text field, an oversized length, a nested relation name. Every one of these must fail closed.Maintenance. Effectively zero upstream. A single maintainer on Bitbucket with no visible release cadence, no dependents, and no issue traffic means you are adopting a code sample, not a supported library. Budget for internal ownership: fork, vendor, and treat any upstream commit as an unreviewed patch. If the package is used anywhere, add it to the SBOM with an explicit "abandoned / internal fork" annotation so future audits do not flag it as an unexplained dependency.
Support. No vendor, no SLA, no security advisory channel. Escalation is "read the source." For a component sitting directly on the query path of user-facing filters, that is the single largest operational objection — a data-exposure defect here would be discovered by you, not reported to you.
Scaling. Server-side DataTables shifts work to the database by design. Three concrete risks:
length values produce large result sets; clamp server-side.LIKE '%term%' search across joined relations multiplies row counts; without EXPLAIN review and composite indexes on the filterable columns, latency degrades non-linearly with table growth. Establish p95 targets per endpoint and load-test at 10x current row count before rollout.Failure modes.
| Failure | Symptom | Mitigation |
|---|---|---|
| Missing allowlist | Cross-tenant or sensitive-field disclosure via crafted columns[i][data] |
Server-side column map, never derived from request |
| Unindexed sort/filter | p95 latency spikes, DB CPU saturation | Index review, length clamping, query timeouts |
Version skew on ServiceEntityRepository |
Container compile failure on upgrade | Pinned fork, CI matrix against target framework |
| Upstream disappearance | Bitbucket repo made private or deleted | Internal fork + vendored copy in VCS |
| Relation join explosion | Duplicate rows, wrong pagination totals | Explicit distinct/grouping and total-count strategy in tests |
Ramp-up. Low for anyone fluent in Doctrine DQL and Symfony DI; effectively a rewrite for a Laravel/Eloquent team, since none of the surrounding knowledge transfers. Estimate half a day for a Doctrine-fluent engineer to read the class and judge it, and 3–5 days to productionize a hardened internal fork — versus 1–2 days to ship the equivalent with yajra/laravel-datatables in a Laravel app, with a maintained dependency behind it.
Recommendation. Reject as a dependency. In a Laravel context, adopt yajra/laravel-datatables or an in-house allowlisted query-scope implementation. In a Symfony/Doctrine context, reimplement the pattern in-house on a supported Symfony LTS. Revisit only if the project publishes to Packagist with semver tags, CI, tests, a license, documented column allowlisting, and support for Symfony 6.4+/Doctrine ORM 3.
How can I help you explore Laravel packages today?