add models, setup livewire, setup mongodb

This commit is contained in:
yuriko 🦊 2025-05-21 15:14:30 -04:00
parent 9a47b58881
commit c0590a3412
Signed by: jaiden
SSH key fingerprint: SHA256:f8tvveBoXBrKZIQDWLLcpQrKbATUCGg98x2N4YzkDM8
19 changed files with 1281 additions and 318 deletions

View file

@ -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");
});
});