mirror of
https://github.com/NyaaStudios/nyaabooru.git
synced 2025-12-10 05:42:58 +00:00
Add post deletion w/ confirmation, search (broken), profile page
This commit is contained in:
parent
bfb497c367
commit
827d125639
21 changed files with 374 additions and 27 deletions
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue