firefly-iii/routes/api.php

70 lines
3.0 KiB
PHP
Raw Normal View History

2016-09-15 23:19:40 -05:00
<?php
2017-12-10 02:02:26 -06:00
/**
* api.php
* Copyright (c) 2017 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2017-12-17 07:42:33 -06:00
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
2017-12-10 02:02:26 -06:00
*/
2018-02-13 11:24:06 -06:00
Route::group(
['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'about', 'as' => 'api.v1.about.'],
function () {
// Accounts API routes:
Route::get('', ['uses' => 'AboutController@about', 'as' => 'index']);
Route::get('user', ['uses' => 'AboutController@user', 'as' => 'user']);
}
);
2018-02-04 08:57:35 -06:00
Route::group(
2018-02-11 01:08:08 -06:00
['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'accounts', 'as' => 'api.v1.accounts.'],
function () {
// Accounts API routes:
Route::get('', ['uses' => 'AccountController@index', 'as' => 'index']);
Route::post('', ['uses' => 'AccountController@store', 'as' => 'store']);
Route::get('{account}', ['uses' => 'AccountController@show', 'as' => 'show']);
Route::put('{account}', ['uses' => 'AccountController@update', 'as' => 'update']);
Route::delete('{account}', ['uses' => 'AccountController@delete', 'as' => 'delete']);
}
);
Route::group(
['middleware' => ['auth:api', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'bills', 'as' => 'api.v1.bills.'], function () {
2018-02-04 08:57:35 -06:00
2018-02-06 11:12:31 -06:00
// Bills API routes:
2018-02-04 08:57:35 -06:00
Route::get('', ['uses' => 'BillController@index', 'as' => 'index']);
2018-02-06 11:12:31 -06:00
Route::post('', ['uses' => 'BillController@store', 'as' => 'store']);
2018-02-04 08:57:35 -06:00
Route::get('{bill}', ['uses' => 'BillController@show', 'as' => 'show']);
2018-02-06 11:12:31 -06:00
Route::put('{bill}', ['uses' => 'BillController@update', 'as' => 'update']);
Route::delete('{bill}', ['uses' => 'BillController@delete', 'as' => 'delete']);
2017-12-29 02:05:35 -06:00
}
);
2018-02-11 01:08:08 -06:00
2018-02-13 11:24:06 -06:00
Route::group(
['middleware' => ['auth:api', 'bindings', \FireflyIII\Http\Middleware\IsAdmin::class], 'namespace' => 'FireflyIII\Api\V1\Controllers', 'prefix' => 'users', 'as' => 'api.v1.users.'],
function () {
// Users API routes:
Route::get('', ['uses' => 'UserController@index', 'as' => 'index']);
Route::post('', ['uses' => 'UserController@store', 'as' => 'store']);
Route::get('{user}', ['uses' => 'UserController@show', 'as' => 'show']);
Route::put('{user}', ['uses' => 'UserController@update', 'as' => 'update']);
Route::delete('{user}', ['uses' => 'UserController@delete', 'as' => 'delete']);
}
);