mirror of
https://github.com/NyaaStudios/nyaabooru.git
synced 2025-12-10 05:42:58 +00:00
46 lines
1.6 KiB
PHP
46 lines
1.6 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\DeletionController;
|
|
use App\Livewire\App\Home as AppHome;
|
|
use App\Livewire\Pages\Profile as ProfilePage;
|
|
use App\Livewire\Pages\Upload as UploadPage;
|
|
use App\Livewire\Posts\Index as PostsPage;
|
|
use App\Livewire\Posts\Edit as EditPost;
|
|
use App\Livewire\Posts\View as ViewPost;
|
|
use App\Livewire\Tags\Index as TagsIndexPage;
|
|
use App\Livewire\Tags\Groups as TagGroupsPage;
|
|
use App\Models\Post;
|
|
use Illuminate\Support\Facades\Route;
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
Route::get('/', AppHome::class)->name('home');
|
|
|
|
// Authenticated routes
|
|
Route::middleware('auth')->group(function () {
|
|
Route::get('/upload', UploadPage::class)->name('upload');
|
|
Route::get('/profiles/{user}', ProfilePage::class);
|
|
});
|
|
|
|
// Post routes
|
|
Route::middleware('auth')->prefix('posts')->group(function () {
|
|
Route::get('/', PostsPage::class)->name('posts.home');
|
|
Route::get('/{post}', ViewPost::class);
|
|
Route::get('/{post}/edit', EditPost::class);
|
|
Route::get('/{post}/download', function(Post $post) {
|
|
return Storage::download("posts/$post->id/full", config('app.name') . "_$post->id.$post->extension");
|
|
});
|
|
});
|
|
|
|
// Tag routes
|
|
Route::middleware('auth')->prefix('tags')->group(function () {
|
|
Route::get('/', TagsIndexPage::class)->name('tags.home');
|
|
Route::get('/groups', TagGroupsPage::class)->name('tags.groups');
|
|
});
|
|
|
|
// Object deletion routes
|
|
Route::middleware('auth')->prefix('delete')->controller(DeletionController::class)->group(function () {
|
|
Route::get('comment/{comment}', 'deleteComment');
|
|
Route::get('post/{post}', 'deletePost');
|
|
Route::get('tag/{tag}', 'deleteTag');
|
|
Route::get('group/{tagGroup}', 'deleteTagGroup');
|
|
});
|