<?php

use Illuminate\Support\Facades\Route;

Route::group(['prefix' => 'segment', 'as' => 'segment.', 'namespace' => 'Segments'], function () {
    Route::get('/{id}/show', 'FetchSegmentController@fetch')->name('show');
    Route::post('/create', 'CreateSegmentController@create')->name('create');
    Route::put('/update/{id}', 'UpdateSegmentController@update')->name('update');
    Route::delete('/delete/{id}', 'DeleteSegmentController@delete')->name('delete');
    Route::get('/list', 'ListSegmentsController@list')->name('list');

    Route::group(['prefix' => '{id}/constant', 'as' => 'constant.'], function () {
        Route::put('/service/update', 'UpdateCustomServiceConstantController@update')->name('service.update');
        Route::put('/update', 'UpdateConstantController@update')->name('update');
        Route::get('/show/{reference}', 'FetchConstantController@fetch')->name('show');
    });

});

//Route::group(['namespace' => 'StandardSegments'], function () {
//    Route::group(['middleware' => 'valid.token'], function () {
//        Route::group(['prefix' => 'standard-segment'], function () {
//            Route::get('/list', 'ListStandardSegmentsController@list')->name('standard_segment.list');
//        });
//    });
//});
//
//Route::group(['namespace' => 'Segments'], function () {
//    Route::group(['middleware' => 'valid.token'], function () {
//        Route::group(['prefix' => 'segment'], function () {
//            Route::post('/create', 'CreateSegmentController@create')->name('segment.create');
//            Route::delete('/delete/{id}', 'DeleteSegmentController@delete')->name('segment.delete');
//    	});
//	});
//});
//
//Route::group(['namespace' => 'StandardSegmentConstants'], function () {
//    Route::group(['middleware' => 'valid.token'], function () {
//        Route::group(['prefix' => 'standard-segment-constant'], function () {
//            Route::get('/list', 'ListStandardSegmentConstantsController@list')->name('standard_segment.list');
//            Route::put('/update/{id}', 'UpdateStandardSegmentConstantController@update')->name('standard_segment_constant.update');
//        });
//    });
//});
//
//Route::group(['namespace' => 'SegmentConstants'], function () {
//    Route::group(['middleware' => 'valid.token'], function () {
//        Route::group(['prefix' => 'segment-constant'], function () {
//            // Route::get('/list', 'ListStandardSegmentConstantsController@list')->name('standard_segment.update');
//            Route::post('/create', 'CreateSegmentConstantController@create')->name('segment_constant.create');
//            Route::put('/update/{id}', 'UpdateSegmentConstantController@update')->name('segment_constant.update');
//        });
//    });
//});