-
Notifications
You must be signed in to change notification settings - Fork 20
статьи и комментарии для профиля #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| public function edit(Post $post): View | ||
| { | ||
| //нужно будет проверять аавтора, если пост существует | ||
| $this->authorize('ownerBool',$post); |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
возможно надо добавить ограничение по символам и типа alpha numeric or просто alpha
app/Policies/OwnerPolicy.php
Outdated
| * | ||
| * @return bool | ||
| */ | ||
| public function ownerBool(User $user, Model $model) |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
надо было назвать колонку is_approved
5489b9d to
fa5738d
Compare
статьи и комментарии для профиля
Нужно сдлать отдельные шаблоны для комментариев в профиле