brendi211 / currency_laravel
This provides Laravel with currency functions such as currency formatting and conversion using up-to-date exchange rates.
1.0
2022-08-13 14:09 UTC
Requires
- php: ^7.2|^8.0
- illuminate/cache: ^6.0|^7.0|^8.0|^9.0
- illuminate/console: ^6.0|^7.0|^8.0|^9.0
- illuminate/support: ^6.0|^7.0|^8.0|^9.0
Requires (Dev)
- mockery/mockery: ^1.3
- phpstan/phpstan: ^0.12.14
- phpunit/phpunit: ^8.0
- squizlabs/php_codesniffer: ^3.5
Suggests
- illuminate/database: Allows for storing of currencies in the database
This package is auto-updated.
Last update: 2025-03-13 19:40:01 UTC
README
Composer From the command line run:
composer require brendi211/currency
Manual Setup Once installed you need to register the service provider with the application. Open up config/app.php and find the providers key.
'providers' => [
\Brendi211\Currency\CurrencyServiceProvider::class,
]
This package also comes with a facade, which provides an easy way to call the the class. Open up config/app.php and find the aliases key.
'aliases' => [
'Currency' => \Brendi211\Currency\Facades\Currency::class,
];
next
php artisan vendor:publish --provider="Brendi211\Currency\CurrencyServiceProvider" --tag=config
A configuration file will be published to config/currency.php.
Migration
php artisan vendor:publish --provider="Brendi211\Currency\CurrencyServiceProvider" --tag=migrations
Run this on the command line from the root of your project to generate the table for storing currencies:
php artisan migrate
Middleware
protected $middleware = [
\Illuminate\Session\Middleware\StartSession::class
\Brendi211\Currency\Middleware\CurrencyMiddleware::class,
]