<?php

namespace Modules\Bitrix\Providers;

use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Route;

class RouteServiceProvider extends ServiceProvider
{

    public function map()
    {
        $this->registerWebRoutes();
    }

    protected function registerWebRoutes()
    {
        //Add Web Routes with web Guard
        Route::middleware('web')
            //Set Default Controllers Namespace
            ->namespace('Modules\\Bitrix\\Http\\Controllers')
            ->group(app_path('Modules/Bitrix/Routes/web.php'));

        Route::middleware('api')
            ->namespace('Modules\\Bitrix\\Http\\Controllers')
            ->prefix('api/bx')
            ->group(app_path('Modules/Bitrix/Routes/api.php'));
    }
}