web.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. use App\Http\Controllers\dataManipulator;
  3. use App\Settings;
  4. use Illuminate\Support\Facades\Route;
  5. /*
  6. |--------------------------------------------------------------------------
  7. | Web Routes
  8. |--------------------------------------------------------------------------
  9. |
  10. | Here is where you can register web routes for your application. These
  11. | routes are loaded by the RouteServiceProvider within a group which
  12. | contains the "web" middleware group. Now create something great!
  13. |
  14. */
  15. Route::get('/', function () {
  16. return view('welcome', ['srv_state'=>dataManipulator::objArrToAssoc(Settings::all())]);
  17. });
  18. Route::get('/lang/{locale}', function ($locale) {
  19. if (! in_array($locale, ['en', 'ru'])) {
  20. abort(400);
  21. }
  22. App::setLocale($locale);
  23. return view('welcome');
  24. });
  25. Auth::routes();
  26. Route::get('/home', 'MusicController@index')->name('home');
  27. Route::get('/music/play/{music}/', 'MusicController@playlog')->name('mplay');
  28. Route::get('/music/download/{music}/', 'MusicController@dwlog')->name('mdown');
  29. Route::get('/music/rename/{music}/', 'MusicController@update')->name('mrename');
  30. Route::get('/music/scan/', 'MusicController@filerefresh')->name('rescan');
  31. Route::get('/users/', 'HomeController@usersControl')->name('ucontrol');
  32. Route::get('/users/{user}', 'HomeController@userSwitch')->name('uswitch');
  33. Route::get('/users_shutdown', 'HomeController@userShutdown')->name('ushutdown');
  34. Route::get('/users_allow', 'HomeController@userGreenlight')->name('ugreen');
  35. Route::get('/pwreset/{user}/{orig}', 'HomeController@pwResetAsk')->name('asknepw');
  36. Route::post('/pwupdate/{user}', 'HomeController@usrUpdatePw')->name('nepwupd');
  37. Route::post('/lockreg', 'HomeController@switchRegLock')->name('lockregon');
  38. Route::get('/lockoff', 'HomeController@switchRegLock')->name('lockregoff');
  39. Route::get('/useradd', 'HomeController@userAdd')->name('manualadd');
  40. Route::post('/plususer', 'HomeController@addNewUser')->name('addnewuser');