mirror of
https://github.com/NyaaStudios/nyaabooru.git
synced 2025-12-10 05:42:58 +00:00
add models, setup livewire, setup mongodb
This commit is contained in:
parent
9a47b58881
commit
c0590a3412
19 changed files with 1281 additions and 318 deletions
|
|
@ -1,7 +1,27 @@
|
|||
<?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('/', function () {
|
||||
return view('welcome');
|
||||
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");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue