- Is happyr/normal-distribution-bundle compatible with Laravel?
- No. This is a Symfony bundle: it ships a Bundle class extending Symfony's HttpKernel Bundle, a DependencyInjection extension, and YAML service definitions that are compiled into the Symfony container at kernel boot. Laravel has no bundle concept, no container compilation pass, and no kernel that will ever load that class. Installing it into a Laravel app registers no service provider, facade, config file, or auto-discovered package.
- What happens if I run composer require happyr/normal-distribution-bundle in a Laravel project?
- Composer may resolve and download it, but nothing will be wired into your application. You get an unused Symfony bundle sitting in vendor/ with no service provider and no facade. In practice the install usually fails first on platform resolution, because the package's constraints target PHP 7 and Symfony 3.4 through 5.
- Why does composer require fail with a platform or dependency resolution error?
- The last release was 2020-09-15, so its composer.json almost certainly pins php to ^7.x and symfony/framework-bundle to ^3.4|^4.0|^5.0. On PHP 8.2 or 8.3 with Laravel 10, 11, or 12 that simply will not resolve. Reaching for --ignore-platform-reqs or constraint aliasing converts a ten-minute task into an afternoon and leaves a landmine for the next upgrade.
- Does this package calculate PDF, CDF, or inverse CDF?
- The overview states it provides helpers for probability density, cumulative distribution, and inverse CDF calculations. However, the package name does not advertise which functions are actually exposed, and PDF versus CDF confusion is the most common defect when this kind of library lands in a codebase. Read the source and confirm the method signatures before assuming.
- What is the best Laravel alternative for normal distribution calculations?
- markrogoyski/math-php is actively maintained and covers the normal distribution plus Poisson, binomial, and exponential if your roadmap grows. If you only need one CDF or PDF, writing roughly 30 to 50 lines with an erf approximation is shorter, reviewable, and fully testable. Either option beats an abandoned transitive dependency.
- How accurate is the normal CDF in the tails, for example beyond z = 3?
- If the implementation uses a polynomial erf approximation, accuracy degrades in the tails where absolute z exceeds about 3. That matters if you use it for SLA breach probability, risk scoring thresholds, or capacity planning at the 99.9th percentile. Verify tail accuracy against reference values before relying on it for anything sensitive.
- Can I use just the math class and skip the Symfony bundle entirely?
- Yes, the underlying PDF and CDF math is framework-agnostic pure PHP, so the Bundle class and DI extension are irrelevant to Laravel. The cleanest route is to vendor the algorithm into something like app/Support/Statistics/ with MIT attribution preserved. Relying on Composer to install the package and then instantiating the class manually works but is fragile because of the stale constraints.
- Is happyr/normal-distribution-bundle still maintained?
- It has not had a release since 2020-09-15, has effectively zero stars and zero dependents, and is owned by a single consultancy whose open source output has largely gone dormant. Zero dependents means zero community validation, so nobody has exercised it against a modern runtime and reported back. Treat it as an algorithm source, not a supported dependency.
- How should I test normal distribution calculations in a Laravel app?
- Unit test against known reference values: the CDF at zero should be 0.5, the PDF should peak at the mean, and the distribution should be symmetric around it. Add explicit tail cases beyond z = 3 and compare them with a trusted table or a maintained library. If you vendor the code, these tests also protect you when PHP or Laravel versions change.
- What license applies and what do I need to do if I copy the code?
- The package is MIT licensed, so vendoring the math class into your application is permitted. You must preserve the copyright notice and license text, typically in a comment block at the top of the copied file or in a NOTICE file. It is a trivial obligation, but it is easy to forget once the class has been moved into app/Support.