<?php

    /*
    |--------------------------------------------------------------------------
    | 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::group(
        [
            'prefix' => LaravelLocalization::setLocale(request()->segment(2))
        ],
        function () {
            // Api Controllers
            Route::group(
                [
                    'prefix' => 'v1',
                ],
                function () {
                    // ENTRIES
                    Route::resource('entries', 'Api\EntryController')->only(['index', 'show']);

                    // STORES
                    Route::resource('stores', 'Api\StoreController')->only(['index', 'show']);

                    // EVENTS
                    Route::get('events/calendar', 'Api\EventController@calendar');
                    Route::resource('events', 'Api\EventController')->only(['index', 'show']);

                    // TAXONOMIES
                    Route::resource('accesses', 'Api\AccessController')->only(['index']);
                    Route::resource('locations', 'Api\LocationController')->only(['index']);
                    Route::resource('categories', 'Api\CategoryController')->only(['index']);
                    Route::resource('inscriptions', 'Api\InscriptionController')->only(['index']);
                    Route::resource('classifications', 'Api\ClassificationController')->only(['index']);
                    Route::resource('roles', 'Api\RoleController')->only(['index']);
                    Route::resource('themes', 'Api\ThemeController')->only(['index']);
                    Route::resource('typologies', 'Api\TypologyController')->only(['index']);
                    Route::resource('chronologies', 'Api\ChronologyController')->only(['index']);
                    Route::resource('places', 'Api\PlaceController')->only(['index']);
                    Route::resource('areas', 'Api\AreaController')->only(['index']);
                    Route::resource('map-properties', 'Api\MapController')->only(['index', 'show']);
                    Route::get('map-notifications', 'Api\MapController@getNotifications');
                    Route::resource('property-images', 'Api\PropertyImagesController')->only(['show']);
                    Route::resource('epigraphs', 'Api\EpigraphController')->only(['index', 'show']);
                    Route::resource('map-routes', 'Api\RouteController')->only(['index']);
                    Route::resource('characters', 'Api\CharacterController')->only(['index']);
                    Route::resource('products', 'Api\ProductController')->only(['index', 'show']);
                    Route::resource('mini-documentaries', 'Api\MiniDocumentaryController')->only(['index', 'show']);

                    Route::resource('partners', 'Api\PartnerController')->only(['index']);
                    Route::resource('multimedia', 'Api\MultimediaController')->only(['index']);
                    //                Route::resource('keywords', 'KeywordController',
                    //                    ['only' => ['index', 'show']]);

                    Route::resource('documents', 'Api\DocumentController')->only(['index']);
                    Route::resource('qrcode', 'Api\QrCodeController')->only(['show']);
                    Route::get('search', 'Api\SearchController@show');
                    Route::get('filter', 'Api\FilterController@get');
                    Route::get('glossary', 'Api\GlossaryController@index');
                }
            );
        }
    );
