<?php

Route::redirect('/', '/login');

Route::redirect('/home', '/admin');

Auth::routes(['register' => false]);

Route::group(['prefix' => 'admin', 'as' => 'admin.', 'namespace' => 'Admin', 'middleware' => ['auth']], function () {
    Route::get('/', 'HomeController@index')->name('home');

    Route::delete('permissions/destroy', 'PermissionsController@massDestroy')->name('permissions.massDestroy');

    Route::resource('permissions', 'PermissionsController');

    Route::delete('roles/destroy', 'RolesController@massDestroy')->name('roles.massDestroy');

    Route::resource('roles', 'RolesController');

    Route::delete('users/destroy', 'UsersController@massDestroy')->name('users.massDestroy');

    Route::resource('users', 'UsersController');

    Route::delete('referensis/destroy', 'ReferensiController@massDestroy')->name('referensis.massDestroy');

    Route::resource('referensis', 'ReferensiController');

    Route::delete('identitas-kliens/destroy', 'IdentitasKlienController@massDestroy')->name('identitas-kliens.massDestroy');

    Route::resource('identitas-kliens', 'IdentitasKlienController');

    Route::delete('litmas-sidangs/destroy', 'LitmasSidangController@massDestroy')->name('litmas-sidangs.massDestroy');

    Route::resource('litmas-sidangs', 'LitmasSidangController');

    Route::delete('bimbingans/destroy', 'BimbinganController@massDestroy')->name('bimbingans.massDestroy');

    Route::resource('bimbingans', 'BimbinganController');

    Route::delete('kunjungans/destroy', 'KunjunganController@massDestroy')->name('kunjungans.massDestroy');

    Route::resource('kunjungans', 'KunjunganController');

    Route::delete('kegiatanpkapks/destroy', 'KegiatanpkapkController@massDestroy')->name('kegiatanpkapks.massDestroy');

    Route::resource('kegiatanpkapks', 'KegiatanpkapkController');

    Route::post('kegiatanpkapks/media', 'KegiatanpkapkController@storeMedia')->name('kegiatanpkapks.storeMedia');

    Route::delete('pengakhirans/destroy', 'PengakhiranController@massDestroy')->name('pengakhirans.massDestroy');

    Route::resource('pengakhirans', 'PengakhiranController');

    Route::delete('pelimpahans/destroy', 'PelimpahanController@massDestroy')->name('pelimpahans.massDestroy');

    Route::resource('pelimpahans', 'PelimpahanController');

    Route::delete('dokumen/destroy', 'DokumenController@massDestroy')->name('dokumen.massDestroy');

    Route::resource('dokumen', 'DokumenController');

    Route::delete('pendampingans/destroy', 'PendampinganController@massDestroy')->name('pendampingans.massDestroy');

    Route::resource('pendampingans', 'PendampinganController');

    Route::delete('pengawasans/destroy', 'PengawasanController@massDestroy')->name('pengawasans.massDestroy');

    Route::resource('pengawasans', 'PengawasanController');

    Route::delete('penilaianaks/destroy', 'PenilaianakController@massDestroy')->name('penilaianaks.massDestroy');

    Route::resource('penilaianaks', 'PenilaianakController');

    Route::delete('referensipkapks/destroy', 'ReferensipkapkController@massDestroy')->name('referensipkapks.massDestroy');

    Route::resource('referensipkapks', 'ReferensipkapkController');

    Route::delete('homes/destroy', 'HomeController@massDestroy')->name('homes.massDestroy');

    Route::resource('homes', 'HomeController', ['except' => ['create', 'store', 'edit', 'update', 'show', 'destroy']]);

    Route::delete('teams/destroy', 'TeamController@massDestroy')->name('teams.massDestroy');

    Route::resource('teams', 'TeamController');
});
