Add post deletion w/ confirmation, search (broken), profile page

This commit is contained in:
yuriko 🦊 2025-05-24 19:30:44 -04:00
parent bfb497c367
commit 827d125639
21 changed files with 374 additions and 27 deletions

View file

@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use App\Models\Comment;
use App\Models\Post;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
@ -19,4 +20,12 @@ class DeletionController extends Controller
$comment->delete();
return redirect("/posts/$postid");
}
public function deletePost(Post $post)
{
$post->featured = null;
$post->save();
$post->delete();
return redirect()->route('posts.home');
}
}