<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::middleware('auth:api')->get('/user', function (Request $request) {
return new \App\Http\Resources\UserResource($request->user());
});
Route::group(['middleware' => 'guest:api'], function () {
Route::post('login', 'Auth\LoginController@login');
});
Route::group(['middleware' => 'auth:api'], function () {
Route::post('logout', 'Auth\LoginController@logout');
Route::group(['middleware' => 'admin'], function () {
Route::get('capec', 'CapecController@index');
});
Route::group(['prefix' => 'v1'], function () {
Route::post('adt', 'V1\Partners\AdtController@store');
Route::post('xlsiem', 'V1\Partners\XlsiemController@store');
Route::group(['prefix' => 'ceptd', 'middleware' => 'admin'], function () {
Route::get('start', 'V1\Components\CeptdController@start');
Route::get('status', 'V1\Components\CeptdController@status');
Route::get('stop', 'V1\Components\CeptdController@stop');
});
Route::group(['prefix' => 'mltd', 'middleware' => 'admin'], function () {
Route::get('start', 'V1\Components\MltdController@start');
Route::get('status', 'V1\Components\MltdController@status');
Route::get('stop/{pid}', 'V1\Components\MltdController@stop');
Route::get('{train_id}/{top}', 'V1\Components\MltdController@train');
});
Route::group(['prefix' => 'od', 'middleware' => 'admin'], function () {
Route::get('start', 'V1\Components\OdController@start');
Route::get('status', 'V1\Components\OdController@status');
Route::get('stop/{pid}', 'V1\Components\OdController@stop');
Route::post('analyze/{pid}', 'V1\Components\OdController@analyze');
});
});
});