You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
4.1 KiB
86 lines
4.1 KiB
<?php |
|
|
|
use Illuminate\Support\Facades\Route; |
|
use App\Http\Controllers\RoleController; |
|
use App\Http\Controllers\UserController; |
|
|
|
use Illuminate\Http\Request; |
|
use Illuminate\Support\Facades\Log; |
|
|
|
/* |
|
|-------------------------------------------------------------------------- |
|
| Web Routes |
|
|-------------------------------------------------------------------------- |
|
| |
|
| Here is where you can register web routes for your application. These |
|
| routes are loaded by the RouteServiceProvider and all of them will |
|
| be assigned to the "web" middleware group. Make something great! |
|
| |
|
*/ |
|
|
|
// Route::get('/', function () { |
|
// // dd(User::find(1)->hasPermissionTo('role-create')); |
|
// // $user = User::find(1); |
|
// // $role = Role::find(1); |
|
// // $permissions = Permission::pluck('id','id')->all(); |
|
// // $role->syncPermissions($permissions); |
|
// // $user->assignRole([$role->id]); |
|
// return view('welcome'); |
|
// }); |
|
|
|
// Route::post('/X/SH', function (Request $request) { |
|
// // save file request->all |
|
// Log::info(json_encode($request->all(), JSON_UNESCAPED_UNICODE)); |
|
// return json_encode($request->all(), JSON_UNESCAPED_UNICODE); |
|
// }); |
|
Route::get('test/downloadZip', [App\Http\Controllers\system\SystemController::class, 'downloadZip'])->name('test.downloadZip'); |
|
|
|
Auth::routes(['register' => false]); |
|
|
|
Route::group(['middleware' => ['auth']], function () { |
|
Route::get('/', [App\Http\Controllers\system\SystemController::class, 'index'])->name('system.dashboard'); |
|
Route::get('/system/role-manager', [App\Http\Controllers\system\Permissions\RoleController::class, 'RoleManager'])->name('system.setting.RoleManager'); |
|
Route::get('/system/user-manager', [App\Http\Controllers\system\Permissions\UserController::class, 'UserManager'])->name('system.setting.UserManager'); |
|
Route::get('/system/setting', [App\Http\Controllers\system\SystemController::class, 'Setting'])->name('system.setting'); |
|
Route::get('/system/log', [App\Http\Controllers\system\LogController::class, 'index'])->name('system.setting.log'); |
|
// 匯出下載 |
|
Route::get('export/{fileName}', [App\Http\Controllers\system\SystemController::class, 'Export'])->name('export'); |
|
|
|
// 新報表(固定種類) |
|
Route::get('/statistics/{type}', [App\Http\Controllers\system\StatisticsController::class, 'index'])->name('system.statistics'); |
|
|
|
// 檔案索引表 |
|
Route::get('/file-index', [App\Http\Controllers\system\FileIndexController::class, 'index'])->name('system.fileindex'); |
|
// 檔案下載 |
|
Route::get('/file-download/{path}', [App\Http\Controllers\system\FileIndexController::class, 'downloadFile'])->name('system.filedownload'); |
|
// API php artisan make:controller system/FileIndexController --api |
|
#region Ping IP |
|
Route::get('/monitor/ipcam', [App\Http\Controllers\system\Monitor\PingIpController::class, 'index'])->name("ping.index"); |
|
#endregion |
|
}); |
|
|
|
|
|
|
|
#region 取得圖片/影片 |
|
Route::group(['middleware' => 'auth'], function () { |
|
Route::get('getViolationImage/{path}', [App\Http\Controllers\System\SystemController::class, 'getViolationImage'])->name('api.getviolationimage'); |
|
Route::get('getViolationVideo/{path}', [App\Http\Controllers\System\SystemController::class, 'getViolationVideo'])->name('api.getviolationvideo'); |
|
|
|
Route::get('auth/resetpwd', [App\Http\Controllers\AuthController::class, 'resetPassword'])->name('auth.resetpwd'); |
|
Route::put('auth/updatepwd', [App\Http\Controllers\AuthController::class, 'updatePassword'])->name('auth.updatepwd'); |
|
}); |
|
#endregion |
|
// Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home'); |
|
|
|
// 系統管理/後台 middleware:auth 代表必須登入才能進入 |
|
Route::group(['prefix' => 'system', 'middleware' => 'auth'], function () { |
|
}); |
|
// Route::group(['middleware' => ['auth']], function () { |
|
// Route::resource('roles', RoleController::class); |
|
// Route::resource('users', UserController::class); |
|
// }); |
|
|
|
Route::get('test-broadcast', function (Request $request) { |
|
broadcast(new \App\Events\ExampleEvent($request->msg)); |
|
// dd(env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_')) |
|
});
|
|
|