<?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::group(
    [
        'prefix' => LaravelLocalization::setLocale()
    ],
    function () {
        Route::group(
            [
                'prefix' => 'api'
            ], function () {
                Route::get('entries/{slug?}/{entity?}', 'Api\EntryController@show');
                Route::get('blocks/{slug}', 'Api\EntryController@getBlock');
                Route::get('faqs', 'Api\FaqsController@list');
                Route::get('faq-categories/{categorySlug}', 'Api\FaqsController@faqCategory');
                Route::post('faqs/{id}/view', 'Api\FaqsController@view');
                Route::get('site-data', 'Api\GlobalController@getSiteData');
                Route::post('contact-form', 'Api\GlobalController@postContactForm');
            }
        );
    }
);
