<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Auth::routes();
Route::get('/', 'HomeController@index')->name('home');

//submit like
Route::get('/server/comment', 'ServerController@comment');
Route::post('/server/comment', 'ServerController@submitComment');

Route::get('/service/live', 'ServiceController@live');
// Route::post('/service/live', 'ServerController@dataLV');

Route::get('/service/follower', 'ServicesController@follower');
Route::post('/service/follower', 'ServicesController@submitf');

Route::get('/server/{serverLink}/{id}', 'ServerController@server');
Route::post('/server/{serverLink}/{id}', 'ServerController@submitLike');
// Route::get('/server/{serverLink}', 'ServerController@server');
// Route::post('/server/{serverLink}', 'ServerController@submitLike');

//Story
Route::get('/service/story', 'ServiceController@story');
Route::post('/service/submitstory', 'ServiceController@dataVS');

//Comment
Route::get('/service/comment', 'ServiceController@comment');
Route::post('/service/submitcomments', 'ServiceController@dataC');

//Like Comment
Route::get('/service/likecomment', 'ServiceController@likecomment');
Route::post('/service/submitlc', 'ServiceController@datalc');

//Like 1,2,3
Route::get('/service/like/{id}', 'LikeController@likes');
Route::post('/service/submitlike/{id}', 'LikeController@order');

Route::get('/admin/mass_extends', 'AdminController@massView');
Route::post('/admin/mass_extends', 'AdminController@mass');

Route::get('/admin/transfer', 'AdminController@transferView');
Route::post('/admin/transfer', 'AdminController@transfer');

Route::get('/admin/decrease', 'AdminController@decreaseView');
Route::post('/admin/decrease', 'AdminController@decrease');

Route::get('/user/get_user_list_expired', 'UserController@userListExpired')->name('users.expired.list');
Route::get('/user/user_list_expired', 'UserController@userListViewExpired');

Route::get('/user/get_user_list_active', 'UserController@userListActive')->name('users.active.list');
Route::get('/user/user_list_active', 'UserController@userListViewActive');

Route::get('/user/history/get_submit_list', 'UserController@historySubmitList')->name('submits.list');
Route::get('/user/history/submit', 'UserController@historySubmitView');

Route::get('/user/history/get_balance_list', 'UserController@historyBalanceList')->name('balance.list');
Route::get('/user/history/balance', 'UserController@historyBalanceView');

Route::get('/user/register', 'UserController@addUser');
Route::post('/user/register', 'UserController@saveUser');

Route::get('/user/extend', 'UserController@extendView');
Route::post('/user/extend', 'UserController@extend');

Route::get('/user/auto_saldo', 'UserController@autoSaldoView');
Route::post('/user/auto_saldo', 'UserController@autoSaldo');
Route::post('/user/auto_saldo/confirm', 'UserController@autoSaldoNext');
Route::post('/user/auto_saldo/back', 'UserController@autoSaldoPrev');
Route::get('/user/auto_saldo/confirm', 'UserController@error');
Route::get('/user/auto_saldo/back', 'UserController@error');

Route::get('/user/auto_extend', 'UserController@autoExtendView');
Route::post('/user/auto_extend', 'UserController@autoExtend');
Route::post('/user/auto_extend/confirm', 'UserController@autoExtendNext');
Route::post('/user/auto_extend/back', 'UserController@autoExtendPrev');
Route::get('/user/auto_extend/confirm', 'UserController@error');
Route::get('/user/auto_extend/back', 'UserController@error');

Route::get('/user/change_password', 'UserController@changeView');
Route::post('/user/change_password', 'UserController@change');

Route::get('/admin/change_password/{id}', 'UserController@changeUserView');
Route::post('/admin/change_password', 'UserController@changeUser');

Route::get('/user/suspend/{id}', 'UserController@suspend');



//Clear Cache facade value:
Route::get('/clear-cache', function() {
    $exitCode = Artisan::call('up');
    return '<h1>Cache facade value cleared</h1>';
});

//Reoptimized class loader:
Route::get('/optimize', function() {
    $exitCode = Artisan::call('optimize');
    return '<h1>Reoptimized class loader</h1>';
});

//Route cache:
Route::get('/route-cache', function() {
    $exitCode = Artisan::call('route:cache');
    return '<h1>Routes cached</h1>';
});

//Clear Route cache:
Route::get('/route-clear', function() {
    $exitCode = Artisan::call('route:clear');
    return '<h1>Route cache cleared</h1>';
});

//Clear View cache:
Route::get('/view-clear', function() {
    $exitCode = Artisan::call('view:clear');
    return '<h1>View cache cleared</h1>';
});

//Clear Config cache:
Route::get('/config-cache', function() {
    $exitCode = Artisan::call('config:cache');
    return '<h1>Clear Config cleared</h1>';
});
