mirror of
https://github.com/flarum/framework.git
synced 2025-01-21 16:24:16 +08:00
fix
This commit is contained in:
parent
06fef7eec0
commit
bf5b522818
|
@ -118,7 +118,8 @@ class TagResource extends AbstractDatabaseResource
|
|||
Schema\Integer::make('discussionCount'),
|
||||
Schema\Integer::make('position')
|
||||
->nullable(),
|
||||
Schema\Str::make('defaultSort'),
|
||||
Schema\Str::make('defaultSort')
|
||||
->nullable(),
|
||||
Schema\Boolean::make('isChild')
|
||||
->get(fn (Tag $tag) => (bool) $tag->parent_id),
|
||||
Schema\DateTime::make('lastPostedAt'),
|
||||
|
|
|
@ -34,7 +34,7 @@ use Illuminate\Database\Query\Builder as QueryBuilder;
|
|||
* @property bool $is_primary
|
||||
* @property int $position
|
||||
* @property int $parent_id
|
||||
* @property string $default_sort
|
||||
* @property string|null $default_sort
|
||||
* @property bool $is_restricted
|
||||
* @property bool $is_hidden
|
||||
* @property int $discussion_count
|
||||
|
|
|
@ -245,11 +245,11 @@ class PostResource extends AbstractDatabaseResource
|
|||
->visible(fn (Post $post) => $post->hidden_at !== null),
|
||||
|
||||
Schema\Boolean::make('canEdit')
|
||||
->visible(fn (Post $post, Context $context) => $context->getActor()->can('edit', $post)),
|
||||
->get(fn (Post $post, Context $context) => $context->getActor()->can('edit', $post)),
|
||||
Schema\Boolean::make('canDelete')
|
||||
->visible(fn (Post $post, Context $context) => $context->getActor()->can('delete', $post)),
|
||||
->get(fn (Post $post, Context $context) => $context->getActor()->can('delete', $post)),
|
||||
Schema\Boolean::make('canHide')
|
||||
->visible(fn (Post $post, Context $context) => $context->getActor()->can('hide', $post)),
|
||||
->get(fn (Post $post, Context $context) => $context->getActor()->can('hide', $post)),
|
||||
|
||||
Schema\Relationship\ToOne::make('user')
|
||||
->includable(),
|
||||
|
|
Loading…
Reference in New Issue
Block a user