mirror of
https://github.com/flarum/core.git
synced 2025-08-03 23:17:43 +02:00
fix
This commit is contained in:
@@ -118,7 +118,8 @@ class TagResource extends AbstractDatabaseResource
|
|||||||
Schema\Integer::make('discussionCount'),
|
Schema\Integer::make('discussionCount'),
|
||||||
Schema\Integer::make('position')
|
Schema\Integer::make('position')
|
||||||
->nullable(),
|
->nullable(),
|
||||||
Schema\Str::make('defaultSort'),
|
Schema\Str::make('defaultSort')
|
||||||
|
->nullable(),
|
||||||
Schema\Boolean::make('isChild')
|
Schema\Boolean::make('isChild')
|
||||||
->get(fn (Tag $tag) => (bool) $tag->parent_id),
|
->get(fn (Tag $tag) => (bool) $tag->parent_id),
|
||||||
Schema\DateTime::make('lastPostedAt'),
|
Schema\DateTime::make('lastPostedAt'),
|
||||||
|
@@ -34,7 +34,7 @@ use Illuminate\Database\Query\Builder as QueryBuilder;
|
|||||||
* @property bool $is_primary
|
* @property bool $is_primary
|
||||||
* @property int $position
|
* @property int $position
|
||||||
* @property int $parent_id
|
* @property int $parent_id
|
||||||
* @property string $default_sort
|
* @property string|null $default_sort
|
||||||
* @property bool $is_restricted
|
* @property bool $is_restricted
|
||||||
* @property bool $is_hidden
|
* @property bool $is_hidden
|
||||||
* @property int $discussion_count
|
* @property int $discussion_count
|
||||||
|
@@ -245,11 +245,11 @@ class PostResource extends AbstractDatabaseResource
|
|||||||
->visible(fn (Post $post) => $post->hidden_at !== null),
|
->visible(fn (Post $post) => $post->hidden_at !== null),
|
||||||
|
|
||||||
Schema\Boolean::make('canEdit')
|
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')
|
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')
|
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')
|
Schema\Relationship\ToOne::make('user')
|
||||||
->includable(),
|
->includable(),
|
||||||
|
Reference in New Issue
Block a user