FEATURE: merge template namespace and module alias
This commit is contained in:
@@ -11,15 +11,9 @@ use Pingpong\Modules\Routing\Controller;
|
||||
|
||||
class CreateNewComment extends Controller
|
||||
{
|
||||
public function postNew(\Modules\Blog\Article\Http\Requests\CreateNewComment $request, $articleId)
|
||||
public function store(\Modules\Blog\Article\Http\Requests\CreateNewComment $request, \Modules\Blog\Article\Entities\Article $article)
|
||||
{
|
||||
$article = Content::where('id', $articleId)
|
||||
->where('moduleHandler', Article::class)
|
||||
->firstOrFail();
|
||||
|
||||
$article->moduleSettings = json_decode($article->moduleSettings);
|
||||
|
||||
if (!isset($article->moduleSettings->allowComments) || !$article->moduleSettings->allowComments) {
|
||||
if (!isset($article->moduleSettings['allowComments']) || !$article->moduleSettings['allowComments']) {
|
||||
return redirect()
|
||||
->route('page.content', ['url' => $article->url])
|
||||
->with('error', trans('article::comments.disabledComments'));
|
||||
@@ -28,7 +22,7 @@ class CreateNewComment extends Controller
|
||||
$content = $request->message;
|
||||
$user = Auth::user();
|
||||
if ($user) {
|
||||
$name = $user->name;
|
||||
$name = is_null($user->name) ? $user->email : $user->name;
|
||||
$email = $user->email;
|
||||
} else {
|
||||
$name = $request->name;
|
||||
|
||||
Reference in New Issue
Block a user