<?php

Route::resource('albums', 'Web\AlbumsController');
Route::get('albums/statusChange/{id}/{status}', 'Web\AlbumsController@statusChange');
Route::get('albums/delete/{id}', 'Web\AlbumsController@delete')->name('albumDelete');    
    
Route::resource('archivos', 'Web\FilesController');

// Route::resource('autoridades', 'Web\AuthoritiesController');
// Route::get('autoridades/statusChange/{id}/{status}', 'Web\AuthoritiesController@statusChange');
// Route::get('autoridades/delete/{id}', 'Web\AuthoritiesController@delete')->name('autoridadDelete');

Route::resource('multimedia', 'Web\MultimediaController');
Route::get('multimedia/statusChange/{id}/{status}', 'Web\MultimediaController@statusChange');
Route::get('multimedia/delete/{id}', 'Web\MultimediaController@delete')->name('multimediaDelete');

Route::resource('documentos', 'Web\DocumentosController');
Route::get('documento/statusChange/{id}/{status}', 'Web\DocumentosController@statusChange');
Route::get('documento/delete/{id}', 'Web\DocumentosController@delete')->name('documentoDelete');
Route::get('documento/download/{id}', 'Web\DocumentosController@download')->name('documentoDownload');

Route::resource('fotos', 'Web\FotosController', ['parameters' => ['index' => 'filter']]);
Route::get('fotos/statusChange/{id}/{status}', 'Web\FotosController@statusChange');
Route::get('fotos/delete/{id}', 'Web\FotosController@delete')->name('fotosDelete');

/*
Route::get('subirimagen', function () {
    return 'subirimagensubirimagensubirimagen';
});
*/
Route::get('/', [
    'as' => 'welcome',
    'uses' => 'Web\ContentsController@welcome'
]);
Route::get('{category}/{mode}', [
    'as' => 'content.blog',
    'uses' => 'Web\ContentsController@blog'
]);
Route::get('{category}/{mode}/{slug}', [
    'as' => 'content.item',
    'uses' => 'Web\ContentsController@item'
]);
    
Route::group(['middleware' => ['auth']], function () {

    Route::get('content/{category}/{id}', [
        'as' => 'content.status',
        'uses' => 'Web\ContentsController@status'
    ]);
    Route::get('create', [
        'as' => 'content.create',
        'uses' => 'Web\ContentsController@create'
    ]);
    Route::post('contenido/storeNew', [
        'as' => 'content.storeNew',
        'uses' => 'Web\ContentsController@storeNew'
    ]);
    Route::get('contenidoEliminar/deleted/{id}', 'Web\DocumentosController@deleted')->name('contenidoEliminar');
    
    

});

Route::auth();

Route::get('register', function () {
    return redirect('login');
});


Route::get('/home', 'HomeController@index');

Route::group(['middleware'=> 'auth'], function(){

    Route::get('contenido/{category}/{mode}/{id}', [
        'as' => 'content.edit',
        'uses' => 'Web\ContentsController@edit'
    ]);
    Route::post('contenido/store', [
        'as' => 'content.store',
        'uses' => 'Web\ContentsController@store'
    ]);
    Route::get('contenido/eliminar/{id}', [
        'as' => 'contenido.eliminar',
        'uses' => 'Web\ContentsController@eliminar'
    ]);
        
    Route::post('uploadImage', 'Web\ContentsController@uploadImage')->name('uploadImage');
        
});
