onuraycicek/currency
Composer 安装命令:
composer require onuraycicek/currency
包简介
This is my package currency
README 文档
README
Installation
You can install the package via composer:
composer require onuraycicek/currency
php artisan vendor:publish --tag="currency-migrations" php artisan vendor:publish --tag="currency-config" php artisan vendor:publish --tag="currency-seeder" php artisan migrate php artisan db:seed --class=CurrencySeeder
You must be add this libs: Bootstrap 5, Jquery, Select2.
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
Finally you must be add the end (footer) of the layout file: (it's required when you want to use "select-active" attribute)
@stack("footer")
Usage
<x-currency-table select-active></x-currency-table>
Attributes:
select-active: It adds a selectbox above the table so you can check your currencies activity values.
$fromId = 53; $toId = 155; $amount = 100; echo \Onuraycicek\Currency\Currency::convertWithId($fromId, $toId, $amount); $fromCurrencyCode = 'TRY'; $toCurrencyCode = 'USD'; $amount = 100; echo \Onuraycicek\Currency\Currency::convert($fromCurrencyCode, $toCurrencyCode, $amount); var_dump(\Onuraycicek\Currency\Currency::getActiveCurrencies()); $currencyCode = 'TRY'; var_dump(\Onuraycicek\Currency\Currency::getCurrency('TRY')); $currencyId = 1; var_dump(\Onuraycicek\Currency\Currency::getCurrencyById($currencyId)); var_dump(\Onuraycicek\Currency\Models\Currency::all());
Config
return [ 'theme' => 'bootstrap5', 'currencies' => ['TRY', 'USD', 'EUR'], // if it is null, currencies with status 1 will be shown. -> ('currencies' => null) ]; theme: bootstrap5, bootstrap4 (not supported yet) currencies: https://www.html-code-generator.com/php/array/currency-names
Testing
composer test
Credits
License
The MIT License (MIT). Please see License File for more information.
onuraycicek/currency 适用场景与选型建议
onuraycicek/currency 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 57 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 11 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「currency」 「laravel」 「onuraycicek」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 onuraycicek/currency 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 onuraycicek/currency 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 onuraycicek/currency 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Fixer.io data provider for Peso
TCMB Currenct Converter
Immutable PHP currency converter that's data-agnostic.
Alfabank REST API integration
A simple PHP Cryptography Implementation for the Ark Blockchain.
A simple PHP API client for the Ark Blockchain.
统计信息
- 总下载量: 57
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-11-11
