PHPackages                             ridwaanzan/worldcurrency - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. ridwaanzan/worldcurrency

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

ridwaanzan/worldcurrency
========================

World Currency for Laravel

1.1.6(2y ago)020MITPHP

Since Oct 26Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/ridwaanzan/worldcurrency)[ Packagist](https://packagist.org/packages/ridwaanzan/worldcurrency)[ Docs](https://github.com/ridwaanzan)[ RSS](/packages/ridwaanzan-worldcurrency/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (2)Versions (10)Used By (0)

[![Laravel](https://camo.githubusercontent.com/83dd8de3e33807c223bb9c4dcfe4d6878dc29838e0a2ad0105f8f825104b3a1a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31322d4646324432302e737667)](https://packagist.org/packages/ridwaanzan/worldcurrency) [![PHP](https://camo.githubusercontent.com/28ff243530f8f30348a525815f1218ab8de27ca96dba9cb1e40a851a63aa1343/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312d373737424234)](https://packagist.org/packages/ridwaanzan/worldcurrency) [![License](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://packagist.org/packages/ridwaanzan/worldcurrency) [![Latest Stable Version](https://camo.githubusercontent.com/43f6c548436d40012a7ac157b4251caaa1ba0a92e094e150702663721286ff9c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f52656c656173652d537461626c652d677265656e)](https://packagist.org/packages/ridwaanzan/worldcurrency)

`ridwaanzan/worldcurrency` is a Laravel package for all of currency around the world. The package will add files for migrations, seeder (to import data to database) and Model to your Laravel Project.

All currency data will be saved to database, and if you want to get the currency data, you can access trough the Model.

All currency data are from Microsoft official website that i get it at: 26 Oct, 2023. Source:

Quick Instalation
-----------------

[](#quick-instalation)

Open command line or terminal inside the root of your Laravel project, and run this command to install the package:

```
composer require ridwaanzan/worldcurrency

```

Supported Versions
------------------

[](#supported-versions)

Laravel VersionVersionComposer Installation10,11,121.1.7`composer require ridwaanzan/worldcurrency`7,8,91.1.6`composer require ridwaanzan/worldcurrency`### Register Service Provider

[](#register-service-provider)

#### Laravel

[](#laravel)

If you want to try to use this package in Laravel 6 or the older, it will be error when doing the migrations.

Note for old laravel version (7/8/9): To ensure the use of the service providers class you can open file **config/app.php** and add Class `WorldcurrencyServiceProvider` inside the array of Service Providers:

```
// Provider Lain
Ridwaanzan\Worldcurrency\WorldcurrencyServiceProvider::class,

```

### Publish File

[](#publish-file)

Run this command inside your command line or terminal:

```
php artisan worldcurrency:publish

```

When you run the command, it will copying files:

- Migration files from `/packages/ridwaanzan/worldcurrency/src/database/migrations` to `/database/migrations`
- Seeder files from `/packages/ridwaanzan/worldcurrency/src/database/seeds` to `/database/seeds`
- Model files from `/packages/ridwaanzan/worldcurrency/src/database/models` to `/app/Models`

After you run the publish command, you should to run:

```
composer dump-autoload

```

### Migrate and Seeder

[](#migrate-and-seeder)

You have to run this command to insert the data of world currencies to your database:

```
php artisan migrate

```

Import the data of world currencies:

```
php artisan db:seed --class=WorldCurrencySeeder

```

Basic Usage
-----------

[](#basic-usage)

You can use this example of code, to your Laravel project controllers:

```
