Skip to content

Added Fixer.io support and also command to update one currency #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,15 @@
"psr-4": {
"Torann\\Currency\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"Torann\\Currency\\CurrencyServiceProvider"
],
"aliases": {
"Currency": "Torann\\Currency\\Facades\\Currency"
}
}
}
}
19 changes: 17 additions & 2 deletions config/currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,28 @@

'default' => 'USD',

/*
|--------------------------------------------------------------------------
| Source
|--------------------------------------------------------------------------
|
| Select which source to use to retrieve the rates
|
| Fixer http://fixer.io
| Open Exchange Rates https://openexchangerates.org
|
| Supported: "fixer", "openexchangerates"
|
*/

'source' => 'fixer',

/*
|--------------------------------------------------------------------------
| API Key for OpenExchangeRates.org
|--------------------------------------------------------------------------
|
| Only required if you with to use the Open Exchange Rates api. You can
| always just use Yahoo, the current default.
| Only required if you with to use the Open Exchange Rates api.
|
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

use Illuminate\Database\Migrations\Migration;

class AlterCurrencyTableAddUpdateColumn extends Migration
{
/**
* Currencies table name
*
* @var string
*/
protected $table_name;

/**
* Create a new migration instance.
*/
public function __construct()
{
$this->table_name = config('currency.drivers.database.table');
}

/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table($this->table_name, function ($table) {
$table->boolean('auto_update')->default(true)->after('active');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table($this->table_name, function ($table) {
$table->dropColumn('auto_update');
});
}
}
Loading