<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| 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 $request->user();
});
*/
// Maybe this needs language parameters, but we roll without it for now
Route::group(
    [
        'prefix' => 'v1'
    ],
    function () {
        //Route::resource('entries/{subEntity?}', 'Api\EntryController')->only(['index', 'show']);
        Route::get('entries/{slug?}/{entity?}', 'Api\EntryController@show');
        Route::resource('products', 'Api\ProductController')->only(['index', 'show']);
        Route::resource('projects', 'Api\ProjectController')->only(['index']);
        Route::resource('events', 'Api\EventController')->only(['index']);
        Route::resource('publications', 'Api\PublicationController')->only(['index']);
        Route::resource('schematics', 'Api\SchematicController')->only(['index']);
        Route::resource('threedmodels', 'Api\ThreeDModelController')->only(['index']);
        Route::resource('firmwares', 'Api\FirmwareController')->only(['index']);
        Route::resource('apis', 'Api\ApiController')->only(['index']);
        Route::resource('quotes', 'Api\QuoteController')->only(['index']);
        Route::resource('resellers', 'Api\ResellerController')->only(['index']);
        Route::resource('tutorials', 'Api\TutorialController')->only(['index']);
        Route::resource('documentations', 'Api\DocumentationController')->only(['index']);
        Route::get('voucher', 'Api\VoucherController@index');
        Route::get('menus', 'Api\MenuController@index');
        Route::get('search', 'Api\SearchController@search');
        Route::post('form', 'Api\FormController@index');
        Route::post('newsletter', 'Api\NewsletterController@store');
    }
);
