Laravel
Brick\Money
Laravel | Brick\Money | |
---|---|---|
234 | 15 | |
33,312 | 1,731 | |
0.9% | 1.4% | |
10.0 | 6.4 | |
4 days ago | 1 day ago | |
PHP | PHP | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Laravel
-
Move from DDD Laravel make command to Codestarter (fase 2)
Looking at artisan and the Symfony maker bundle, I saw two different ways to build content. Artisan works with stub files which are text files with a Twig syntax for the variables. And the maker bundle works with php templates.
-
Preventing Destructive Commands from Running in Laravel
In PR #51376 to Laravel in May 2024, Jason McCreary and Joel Clermont added the Illuminate\Console\Prohibitable trait to the framework, which was then included in the Laravel 11.9 release.
-
Laravel Under The Hood - The Strategy Pattern
When you call the driver method on the facade, it's proxied to a manager, depending on which facade you're using. In the caching scenario, it's directed to the CacheManager. Let's inspect its code.
-
🚨High-Severity Laravel Vulnerability (CVE-2024-52301) - Awareness and Action Required
For more information on this vulnerability, check out the official Laravel security advisory: GHSA-gv7v-rgg6-548h
- Laravel Reverb in Production Environment
-
New `@bool` Blade directive in Laravel!
While this feature isn't released yet, it's expected to be available soon. Keep an eye on Laravel's official channels for the announcement. In the meantime, check out the merged PR on GitHub! https://github.com/laravel/framework/pull/53179
-
Laravel Pipelines & Composable Job Middleware
Starting in Laravel 11.26, you can now use the artisan make:job-middleware command to generate Job middleware.
- 'Framework': An Advanced Laravel Development Suite
-
How to Contribute to Laravel: A Step-by-Step Guide
Create a new issue in the parent repository, in our case the laravel/framework repository. Be as detailed as you can be for the update you are doing.
-
Tell HN: Laravel's default truncate method uses cascade for Postgres databases
Hope this saves a future team from unexpected behavior resulting in (potential) production data loss.
When using Postgres, Laravel's default method for truncate uses the cascade option, which will ignore foreign key constraints and potentially wipe large amounts of data with no confirmation or warning.
It was originally introduced in 2018: https://github.com/laravel/framework/pull/26389/files
Here are two threads on it if you are curious: https://github.com/laravel/framework/issues/29506
Brick\Money
-
Introducing Bag 1.0: Immutable Values Objects for PHP
For the last couple of years I’ve been using Value Objects in my projects to bring language-level strict types to what would typically be array data structures in my code. From method inputs to JSON API responses, value objects have almost entirely replaced arrays throughout. The ability to get runtime type checking and IDE auto-complete has eliminated many potential bugs, from key typos, to assigning an incorrectly typed value by accident: what type is an “amount” property in a credit card transaction API response? An integer of cents (or other minor units), a Money object such as brick/money or moneyphp/money? Or worst of all, a float?
-
PHP libraries and tools
brick/money: A money and currency library for PHP
-
Weekly help thread
1 - Floating point is not always great for money operations and can introduce odd rounding errors - https://www.php.net/manual/en/language.types.float.php - you might want to use something like this: https://github.com/brick/money
-
PHP is trolling me
He should have said to use Brick/Money https://github.com/brick/money which is based on Brick/Math but is specifically money related.
-
How to format prices?
If you don’t want to do the integer conversions yourself, I highly recommend looking at: https://github.com/brick/money
-
Which native PHP features do you regret not knowing about/adapting earlier?
brick/date-time is great! I personally prefer its interface and functionality over Carbon's. I also really like his money library
- Financial values in PHP
-
Best way to handle PHP float issue
Is the most popular, but https://github.com/brick/money is preferrable IMO. One of the reasons is that it handles not just money, but all arbitrary precision calculations independent of currecy via brick/math.
- Dealing with money
- Weekly "ask anything" thread
What are some alternatives?
treblle-laravel - The official Treblle SDK for Laravel. Seamlessly integrate Treblle to manage communication with your dashboard, send errors, and secure sensitive data.
Money - PHP implementation of Fowler's Money pattern.
fingerprintjs - The most advanced browser fingerprinting library.
laravel-money - Currency formatting and conversion package for Laravel
FrameworkBenchmarks - Source for the TechEmpower Framework Benchmarks project
Brick\Money - A money and currency library for PHP