承接 khetamhamdy/currency-exchange 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

khetamhamdy/currency-exchange

Composer 安装命令:

composer require khetamhamdy/currency-exchange

包简介

A Laravel package for currency exchange and transaction management.

README 文档

README

Introduction

The Currency Exchange package is an open-source PHP library for Laravel that simplifies managing currency exchange operations and transactions. If your application involves working with currencies or financial transactions between currencies, this package provides an efficient solution.

This package is dedicated to my late father, and I hope it helps improve the software development experience.

Features

  • Manage currencies: Add, update, delete, and view currencies.
  • Manage exchange transactions: Add, update, view exchange transactions.
  • Flexible API for currency and transaction data in JSON format.
  • Easy to use and works seamlessly with Laravel 9.0+.

Installation

1. Install via Composer

Install the package in your Laravel application by running the following command in your project directory:

composer require khetamhamdy/currency-exchange

2. Add the Service Provider (if needed)

If you're not using Laravel's package auto-discovery feature, add the service provider manually in the config/app.php file under the providers array:

'providers' => [
    // Other providers...
    KhetamHamdy\CurrencyExchange\Providers\CurrencyExchangeServiceProvider::class,
],

3. Run Migrations

To create the necessary database tables, execute the following command:

php artisan migrate

This will run the migrations provided by the package to set up the required database schema.

Usage

1. Currency Management

Display All Currencies:

use KhetamHamdy\CurrencyExchange\Services\CurrencyService;

$currencyService = app('currency.service');
$currencies = $currencyService->getAllCurrencies();

Add a New Currency:

$currencyService->addCurrency([
    'name' => 'US Dollar',
    'code' => 'USD',
]);

Update a Currency:

$currencyService->updateCurrency($id, [
    'name' => 'Euro',
    'code' => 'EUR',
]);

Delete a Currency:

$currencyService->deleteCurrency($id);

2. Transaction Management

Display All Transactions:

use KhetamHamdy\CurrencyExchange\Services\ExchangeTransactionService;

$exchangeService = app('exchange.service');
$transactions = $exchangeService->listTransactions();

Add a New Transaction:

$exchangeService->createTransaction([
    'from' => 1, // Original currency ID
    'to' => 2,   // Target currency ID
    'rate' => 1.2,
    'date' => now(),
]);

Update a Transaction:

$exchangeService->updateTransaction($id, [
    'from' => 1,
    'to' => 2,
    'rate' => 1.3,
    'date' => now(),
]);

Notes

  • Ensure your application meets the package requirements, including Laravel version 9.0 or higher.
  • Remember to run php artisan migrate after installing the package to set up the database tables.

License

This package is open-sourced software licensed under the MIT license.

khetamhamdy/currency-exchange 适用场景与选型建议

khetamhamdy/currency-exchange 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 4, 最近一次更新时间为 2025 年 01 月 05 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 khetamhamdy/currency-exchange 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 khetamhamdy/currency-exchange 我们能提供哪些服务?
定制开发 / 二次开发

基于 khetamhamdy/currency-exchange 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 21
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-05