mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#2177 emlak24 Yorum-Rating completed
This commit is contained in:
parent
c4cc60bc20
commit
bbf0b7870d
@ -38,7 +38,7 @@
|
||||
|
||||
<!-- Content With Block -->
|
||||
<div id="nav-comments" class="tab-pane fade in">
|
||||
{{ addBlock('ad-detail/content',{'features':features,'entry':adv, 'profile': profile, 'commenturl': 'advs::saveComment', 'entry_type': 'Visiosoft\\AdvsModule\\Adv\\AdvModel'})|raw }}
|
||||
{{ addBlock('ad-detail/content',{'features':features,'entry':adv, 'type': 'adv', 'profile': profile, 'commenturl': 'comments::save_comment', 'entry_type': 'Visiosoft\\AdvsModule\\Adv\\AdvModel'})|raw }}
|
||||
</div>
|
||||
<!-- Content With Block -->
|
||||
</div>
|
||||
|
||||
@ -1070,21 +1070,4 @@ class AdvsController extends PublicController
|
||||
$this->messages->success(trans('visiosoft.module.advs::message.extended', ['number' => $adsExtended]));
|
||||
return $this->redirect->back();
|
||||
}
|
||||
|
||||
public function saveComment($id)
|
||||
{
|
||||
$comment = $this->request->validate([
|
||||
'rating' => 'required',
|
||||
'username' => 'required',
|
||||
'title' => 'required',
|
||||
'detail' => 'required',
|
||||
]);
|
||||
|
||||
if ($adv = $this->adv_repository->find($id)) {
|
||||
event(new CreateNewComment($adv, $comment));
|
||||
$this->messages->success(trans('visiosoft.module.comments::message.comment_success'));
|
||||
} else {
|
||||
$this->messages->error(trans('visiosoft.module.comments::message.comment_error'));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user