brendi211/currency_laravel

此包为Laravel提供了货币格式化和使用最新汇率进行货币转换的货币函数。

1.0 2022-08-13 14:09 UTC

This package is auto-updated.

Last update: 2024-09-13 18:37:42 UTC


README

通过命令行运行Composer

composer require brendi211/currency

手动设置 一旦安装,您需要将服务提供者注册到应用程序中。打开config/app.php并找到providers键。

'providers' => [
    \Brendi211\Currency\CurrencyServiceProvider::class,
]

此包还包含一个门面,提供了一种调用类的方法。打开config/app.php并找到aliases键。

'aliases' => [
    'Currency' => \Brendi211\Currency\Facades\Currency::class,
];

下一页

php artisan vendor:publish --provider="Brendi211\Currency\CurrencyServiceProvider" --tag=config

配置文件将被发布到config/currency.php。

迁移

php artisan vendor:publish --provider="Brendi211\Currency\CurrencyServiceProvider" --tag=migrations

从项目的根目录中运行此命令以生成存储货币的表

php artisan migrate

中间件

protected $middleware = [
    \Illuminate\Session\Middleware\StartSession::class
    \Brendi211\Currency\Middleware\CurrencyMiddleware::class,

]