You've already forked Epicnabbo-Catalogus-Updated-Daily
30 lines
936 B
PHP
30 lines
936 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Articles;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Requests\ArticleCommentFormRequest;
|
|
use App\Models\Articles\WebsiteArticle;
|
|
use App\Models\Articles\WebsiteArticleComment;
|
|
use App\Services\Articles\CommentService;
|
|
use Illuminate\Http\RedirectResponse;
|
|
|
|
class WebsiteArticleCommentsController extends Controller
|
|
{
|
|
public function __construct(public readonly CommentService $commentService) {}
|
|
|
|
public function store(WebsiteArticle $article, ArticleCommentFormRequest $request): RedirectResponse
|
|
{
|
|
$this->commentService->store($request->get('comment'), $article);
|
|
|
|
return back()->with('success', __('You comment has been posted!'));
|
|
}
|
|
|
|
public function destroy(WebsiteArticleComment $comment): RedirectResponse
|
|
{
|
|
$this->commentService->destroy($comment);
|
|
|
|
return back()->with('success', __('You comment has been deleted!'));
|
|
}
|
|
}
|