<?php

Route::group(['prefix' => '/super/admin', 'middleware' => 'system.staging'], function () {

    Route::group(['prefix' => '', 'middleware' => 'auth.user'], function () {
        Route::get('/files', ['as' => 'file.upload', 'uses' => 'FileController@uploadForm']);
        Route::post('/upload/file', ['as' => 'file.upload.submit', 'uses' => 'FileController@uploadFormSubmit']);

    });
    Route::group(['prefix' => '', 'namespace' => "Login"], function () {
        Route::get('/', ['as' => 'login', 'uses' => 'AuthController@index']);
        Route::post('/', ['as' => 'login.submit', 'uses' => 'AuthController@submitLogIn']);
        Route::get('/auth/deactive/logout/', ['as' => 'auth.deactive.logout', 'uses' => 'AuthController@logout']);
    });

    Route::group(['prefix' => '', 'namespace' => 'Login', 'middleware' => 'auth.user'], function () {
        Route::get('/auth/logout', ['as' => 'auth.logout', 'uses' => 'AuthController@logout']);
        Route::get('/dashboard', ['as' => 'dashboard', 'uses' => 'AuthController@dashboard']);
        Route::get('/form', ['as' => 'form', 'uses' => 'SampleController@form']);
        Route::get('/blank', ['as' => 'blank', 'uses' => 'SampleController@blank']);
        Route::get('/list', ['as' => 'list', 'uses' => 'SampleController@list']);

    });


  Route::group(['prefix' => '/PaintingCategory', 'namespace' => 'Admin', 'middleware' => 'auth.user'], function () {
    Route::get('/', ['as' => 'PaintingCategory.list', 'uses' => 'PaintingCategoryController@index']);
    Route::post('/store', ['as' => 'PaintingCategory.store', 'uses' => 'PaintingCategoryController@store']);
    Route::get('/edit/{id}', ['as' => 'PaintingCategory.edit', 'uses' => 'PaintingCategoryController@edit']);
    Route::match(['post', 'put'], '/update/{id}', ['as' => 'PaintingCategory.update', 'uses' => 'PaintingCategoryController@update']);
    Route::any('/delete/{id}', ['as' => 'PaintingCategory.delete', 'uses' => 'PaintingCategoryController@destroy']);
});


// Art Tag Management
Route::group(['prefix' => '/art-tag', 'namespace' => 'Admin'], function () {
    Route::get('/', ['as' => 'artTag.list', 'uses' => 'ArtTagController@index']);
    Route::post('/store', ['as' => 'artTag.store', 'uses' => 'ArtTagController@store']);
    Route::get('/edit/{id}', ['as' => 'artTag.edit', 'uses' => 'ArtTagController@edit']);
    Route::put('/update/{id}', ['as' => 'artTag.update', 'uses' => 'ArtTagController@update']);
    Route::any('/delete/{id}', ['as' => 'artTag.delete', 'uses' => 'ArtTagController@destroy']);
    Route::get('/ajax-list', ['as' => 'artTag.ajaxList', 'uses' => 'ArtTagController@ajaxList']);
});

// Artist Management
Route::group(['prefix' => '/artist', 'namespace' => 'Admin'], function () {
    Route::get('/', ['as' => 'artist.list', 'uses' => 'ArtistController@index']);
    Route::post('/store', ['as' => 'artist.store', 'uses' => 'ArtistController@store']);
    Route::get('/edit/{id}', ['as' => 'artist.edit', 'uses' => 'ArtistController@edit']);
    Route::put('/update/{id}', ['as' => 'artist.update', 'uses' => 'ArtistController@update']);
    Route::any('/delete/{id}', ['as' => 'artist.delete', 'uses' => 'ArtistController@destroy']);
    Route::post('/create-tag', ['as' => 'artist.createTag', 'uses' => 'ArtistController@createTag']);
});


    Route::group(['prefix' => '/product', 'namespace' => 'Admin', 'middleware' => 'auth.user'], function () {
        Route::get('/', ['as' => 'product.list', 'uses' => 'ProductController@list']);
        Route::get('/create', ['as' => 'product.create', 'uses' => 'ProductController@create']);
        Route::post('/store', ['as' => 'product.store', 'uses' => 'ProductController@store']);
        Route::get('/edit/{id}', ['as' => 'product.edit', 'uses' => 'ProductController@edit']);
        Route::post('/update/{id}', ['as' => 'product.update', 'uses' => 'ProductController@update']);
        Route::any('/delete/{id}', ['as' => 'product.delete', 'uses' => 'ProductController@delete']);
        Route::get('/productMeta/{id}', ['as' => 'product.productMeta', 'uses' => 'ProductController@productMeta']);
        Route::post('/update/meta/{id}', ['as' => 'product.update.meta', 'uses' => 'ProductController@update_meta']);


    });


    Route::group(['prefix' => '/art', 'namespace' => 'Admin'], function () {
    Route::get('/', ['as' => 'art.list', 'uses' => 'ArtController@index']);
    Route::post('/store', ['as' => 'art.store', 'uses' => 'ArtController@store']);
    Route::get('/edit/{id}', ['as' => 'art.edit', 'uses' => 'ArtController@edit']);
    Route::put('/update/{id}', ['as' => 'art.update', 'uses' => 'ArtController@update']);
    Route::any('/delete/{id}', ['as' => 'art.delete', 'uses' => 'ArtController@destroy']);

    Route::get('/images/{artId}', ['as' => 'art.images', 'uses' => 'ArtController@getImages']);
    Route::post('/images/upload/{artId}', ['as' => 'art.uploadImages', 'uses' => 'ArtController@uploadImages']);
    Route::delete('/image/delete/{imageId}', ['as' => 'art.deleteImage', 'uses' => 'ArtController@deleteImage']);
  });


  Route::group(['prefix' => '/illustration-category', 'namespace' => 'Admin'], function () {
    Route::get('/', ['as' => 'illustrationCategory.list', 'uses' => 'IllustrationCategoryController@index']);
    Route::post('/store', ['as' => 'illustrationCategory.store', 'uses' => 'IllustrationCategoryController@store']);
    Route::get('/edit/{id}', ['as' => 'illustrationCategory.edit', 'uses' => 'IllustrationCategoryController@edit']);
    Route::put('/update/{id}', ['as' => 'illustrationCategory.update', 'uses' => 'IllustrationCategoryController@update']);
    Route::any('/delete/{id}', ['as' => 'illustrationCategory.delete', 'uses' => 'IllustrationCategoryController@destroy']);
});
Route::group(['prefix' => '/illustration', 'namespace' => 'Admin'], function () {
    Route::get('/', ['as' => 'illustration.list', 'uses' => 'IllustrationController@index']);
    Route::post('/store', ['as' => 'illustration.store', 'uses' => 'IllustrationController@store']);
    Route::get('/edit/{id}', ['as' => 'illustration.edit', 'uses' => 'IllustrationController@edit']);
    Route::put('/update/{id}', ['as' => 'illustration.update', 'uses' => 'IllustrationController@update']);
    Route::any('/delete/{id}', ['as' => 'illustration.delete', 'uses' => 'IllustrationController@destroy']);

    Route::get('/images/{illustrationId}', ['as' => 'illustration.images', 'uses' => 'IllustrationController@getImages']);
    Route::post('/images/upload/{illustrationId}', ['as' => 'illustration.uploadImages', 'uses' => 'IllustrationController@uploadImages']);
    Route::delete('/image/delete/{imageId}', ['as' => 'illustration.deleteImage', 'uses' => 'IllustrationController@deleteImage']);
});
});
