mohebifar/date-time-bundle
A Symfony bundle that provides date and time form types with picker integration, making it easier to add date/time inputs and handle DateTime values cleanly in PHP applications.
Architecture fit — fundamentally mismatched, but salvageable at a fraction of its value. The package is a Symfony2 bundle, not a Laravel package. Three distinct pieces of value exist, and they have very different portability:
DateTime in the domain model and push calendar/display formatting to the presentation edge — is correct and framework-agnostic in principle. This is the seam worth extracting.FormType (non-portable, discard). It depends on symfony/form, AbstractType, and FormBuilderInterface. Laravel does not ship Symfony Form, so this half of the package is dead weight. In Laravel, date selection belongs in a Blade component backed by a client-side datepicker, not a server-side form type.Extension, kernel bundle discovery, and compiler passes have no Laravel analogue. Laravel's service provider model is the replacement, not the bridge.Net: a TPM should frame this as "a ~200-line reference implementation of calendar formatting wrapped in an obsolete framework shell." The architecture concept scores well; the code as a dependency scores poorly.
Integration feasibility — low as a dependency, medium as a source. Adding it to a modern Laravel app means either pulling Symfony Form and legacy Symfony components alongside Laravel (architecturally incoherent, large dependency tree, high conflict probability) or forking and extracting the conversion logic. The extraction path is the only defensible one, and it is a bounded spike — days, not weeks — if the conversion code separates cleanly. That condition is the pivot point for the entire recommendation.
Technical risk — high and compounding. Symfony 2.x is end-of-life (2.8 EOL Nov 2018), which predicts PHP version constraints that predate PHP 8.1 and symfony/* constraints that will conflict with anything a current Laravel app resolves. With 16 stars and 0 dependents there is no community triage, no security response path, and no realistic upstream fix. There is no evidence of a test suite, which matters disproportionately here: leap-year rules, month-length variation, and year-boundary behavior are exactly where calendar code fails, and exactly where untested code is dangerous.
Key questions that gate the decision:
composer.json PHP and symfony/* constraints? Do they conflict with the target Laravel version's framework requirements?AbstractType and the DI extension without a rewrite — i.e., are the pure functions actually pure?IntlDateFormatter (or the intl extension) already cover the requirement? If so, the only differentiated component is the widget, which you should build or vendor elsewhere.If the answer to (3) is "entangled," the correct TPM decision is to stop and adopt a maintained, framework-agnostic alternative (e.g. morilog/jalali or hekmatinasser/verta for Jalali) rather than fund a fork.
Stack fit — no native fit. Laravel expects a service provider, optional facade, config file, Blade directive, validation rule, and Eloquent cast. None exist. The Symfony FormType cannot be surfaced as a Laravel macro without a Form bridge, which is not worth building.
Migration path — mine, don't install. Sequence:
@jalali($model->created_at)), a validation rule for user-entered calendar dates, and an Eloquent cast/accessor so storage stays Gregorian and display is calendar-aware.app/Support with attribution and a pinned source commit reference, not as a VCS composer dependency.Compatibility checks before writing code. Confirm the target Laravel version's PHP floor (Laravel 10/11 → PHP 8.1+). Confirm no symfony/* transitive requirement survives extraction. Confirm the intl and/or calendar PHP extensions are present in the deployment image. Critically: audit whether the package's format tokens shadow PHP's date() tokens while behaving differently — that is a silent-wrong-output bug class and must be documented per-token or renamespaced.
Sequencing — spike first, decide second, build third. Run the audit/extraction as a 1–3 day spike because the go/no-go hinges on how cleanly the math separates. Only after a working extraction should you invest in the Laravel-facing surface (provider, directive, cast, rule). The datepicker replacement is independent and can run in parallel. Do not attempt composer require of the bundle at any point — the resolution risk alone is not worth the cycle, and a silent symfony/* downgrade could break unrelated functionality.
Compare before committing. Price the extraction spike against simply adopting a maintained calendar library. The package is only worth mining if it supports a calendar those libraries do not, or if the audit surfaces conversion code of unusually high quality.
Maintenance — you own it forever. Upstream is dormant; zero dependents means nobody else is filing or fixing issues. Any fork becomes an internal artifact needing an owner, a test suite, and a documented upgrade path. Budget for this explicitly in the roadmap or the code becomes orphaned tribal knowledge within two release cycles. Treat "we forked it" as a standing maintenance line item, not a one-time cost.
Support — none. No vendor, no active maintainer, no community channel, no security response process. The internal team must be able to read and patch calendar arithmetic. If calendar domain knowledge is concentrated in one engineer, that is a single point of failure and a staffing risk the TPM should name.
Scaling — negligible. Conversion is CPU-trivial and stateless; no throughput, memory, or connection-pool risk. The only operational note: avoid per-row conversion in reports over large collections — format at render time or cache the formatted string on the model. Centralize timezone handling so conversions are deterministic regardless of server locale or job context.
Failure modes to design against:
symfony/* component and break unrelated features. This is why extraction, not installation, is the path.date()-style tokens with different semantics produce wrong output that passes review. Enforce a distinct token namespace or a typed formatter API.Ramp-up — asymmetric and mostly front-loaded. The conversion logic is small; a mid-level Laravel developer can own the extracted service in under a week given good tests. The expensive part is understanding Symfony2 idioms (bundle extension, DI compiler passes, FormType hierarchy) — but since the recommendation is to discard them, that cost is confined to the audit. The durable ramp-up risk is domain knowledge: whoever understands the target calendar's rules becomes the bottleneck unless those rules are encoded as executable tests.
Bottom line for the TPM. Do not adopt this as a dependency — dead framework generation, zero dependents, no security path, and a non-portable form layer make it unsuitable. It is worth a short, time-boxed extraction spike only if the audit shows the conversion math separates cleanly and no maintained library covers the same calendar. In most cases the honest recommendation is: cite it as prior art for the localization roadmap, fund a small platform-level date/time formatting component, and ship the datepicker as a shared UI component.
How can I help you explore Laravel packages today?