<?php

use Illuminate\Support\Facades\Route;

use App\Http\Controllers\{PhotoController,VideoController};
use App\Http\Controllers\Auth\LoginController;

Route::view('/home','home');
Route::get('/p/deletes/{id?}',[PhotoController::class,'deletes'])
	->where('id','[0-9]+');
Route::get('/v/deletes/{id?}',[VideoController::class,'deletes'])
	->where('id','[0-9]+');
Route::get('/p/duplicates/{id?}',[PhotoController::class,'duplicates'])
	->where('id','[0-9]+');
Route::get('/v/duplicates/{id?}',[VideoController::class,'duplicates'])
	->where('id','[0-9]+');

Route::view('/p/info/{po}','photo.view')
	->where('po','[0-9]+');
Route::view('/v/info/{vo}','video.view')
	->where('vo','[0-9]+');
Route::get('/p/thumbnail/{o}',[PhotoController::class,'thumbnail'])
	->where('o','[0-9]+');
Route::get('/p/view/{o}',[PhotoController::class,'view'])
	->where('o','[0-9]+');
Route::get('/v/view/{o}',[VideoController::class,'view'])
	->where('o','[0-9]+');

Route::post('/p/delete/{o}',[PhotoController::class,'delete'])
	->where('o','[0-9]+');
Route::post('/v/delete/{o}',[VideoController::class,'delete'])
	->where('o','[0-9]+');
Route::post('/p/duplicates',[PhotoController::class,'duplicatesUpdate']);
Route::post('/v/duplicates',[VideoController::class,'duplicatesUpdate']);
Route::post('/p/deletes',[PhotoController::class,'deletesUpdate']);
Route::post('/v/deletes',[VideoController::class,'deletesUpdate']);
Route::post('/p/undelete/{o}',[PhotoController::class,'undelete'])
	->where('o','[0-9]+');
Route::post('/v/undelete/{o}',[VideoController::class,'undelete'])
	->where('o','[0-9]+');

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

Route::get('/login',[LoginController::class,'showLoginForm'])
	->name('login');