mirror of
https://github.com/NyaaStudios/nyaabooru.git
synced 2025-12-09 21:42:57 +00:00
27 lines
888 B
PHP
27 lines
888 B
PHP
<?php
|
|
|
|
use App\Livewire\App\Home as AppHome;
|
|
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\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');
|
|
});
|
|
|
|
// 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");
|
|
});
|
|
});
|