Skip to content

Conversation

@SadElephant
Copy link
Collaborator

Нужно сдлать отдельные шаблоны для комментариев в профиле

public function edit(Post $post): View
{
//нужно будет проверять аавтора, если пост существует
$this->authorize('ownerBool',$post);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут по PSR пробел нужен, а что такое bool?

],
$request->validate(
[
'name' => 'required|string',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

возможно надо добавить ограничение по символам и типа alpha numeric or просто alpha

*
* @return bool
*/
public function ownerBool(User $user, Model $model)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

если имеется в виду что ожидается bool, то надо добавить тип возвращаемого значения и переименовать в isOwner()

<div class="bg-body-tertiary overflow-hidden px-5 py-3">

@php
$grouped_comments = $comments->sortBy('created_at')->groupBy('child_id');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

по psr то только CamelCase в названии переменных


<div class="small">
<h6 class="mb-0 me-4">
<a href="{{route('profile',$post->user)}}" class="text-body-secondary text-decoration-none">{{ $post->user->name }}</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

пробела нет, надо видимо включить в ide проверки

@if ($isMyAccount)
<li><a class="dropdown-item" href="{{route('post.edit')}}">Редактировать</a></li>
{{--
<li><a class="dropdown-item" href="#">{{route('post.delete')}}</a></li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

забыли удалить


$reply = new Comment([
'comment' => $request->input('message'),
'approved' => true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

надо было назвать колонку is_approved

@SadElephant SadElephant force-pushed the profile branch 5 times, most recently from 5489b9d to fa5738d Compare November 13, 2023 12:36
@tabuna tabuna merged commit 3a042e3 into master Nov 14, 2023
@tabuna tabuna deleted the profile branch November 14, 2023 01:10
ReWiG pushed a commit to ReWiG/laravel.su that referenced this pull request Jul 16, 2025
статьи и комментарии для профиля
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants