Commit ccf14471 authored by Jack Stupple's avatar Jack Stupple

add currencies endpoint

parent 6db0a10f
<?php
namespace App\Http\Controllers\Api;
class CurrencyController extends Controller
{
public function index() {
// raw because <= NOW() is mysql directly into the function and the builder will misunderstand it otherwise
return \App\Currency::all();
}
public function default() {
return \App\Currency::where('currency_code', 'EUR')->first();
}
}
\ No newline at end of file
......@@ -22,6 +22,14 @@ $router->group(
}
);
$router->group(
['prefix' => 'currencies'],
function () use ($router) {
$router->get('/', 'CurrencyController@index');
$router->get('/default', 'CurrencyController@default');
}
);
$router->group(
['prefix' => 'characters'],
function () use ($router) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment