Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to authored and github-actions[bot] committed Nov 5, 2024
1 parent f153743 commit 6c8e8cc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ public function toPage(
array $extra = [],
): mixed;


public function updateField(
?ResourceContract $resource = null,
?PageContract $page = null,
array $extra = []
): string;


public function method(
string $method,
?string $message = null,
Expand All @@ -46,7 +46,7 @@ public function component(
array $additionally = []
): string;


public function reactive(
?PageContract $page = null,
?ResourceContract $resource = null,
Expand Down
2 changes: 1 addition & 1 deletion src/Laravel/src/Resources/ModelResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected function isCan(Ability $ability): bool

$user = MoonShineAuth::getGuard()->user();

$item = in_array($ability, [
$item = \in_array($ability, [
Ability::CREATE,
Ability::MASS_DELETE,
Ability::VIEW_ANY,
Expand Down
8 changes: 5 additions & 3 deletions tests/Feature/Resources/ResourceWithPoliciesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
->setTestFields([
ID::make()->sortable(),
Text::make('Name', 'name')->sortable(),
HasMany::make('Comments',
resource: (new TestCommentResource(app(CoreContract::class)))->setTestPolicy(true))->creatable(),
HasMany::make(
'Comments',
resource: (new TestCommentResource(app(CoreContract::class)))->setTestPolicy(true)
)->creatable(),
])
->setTestPolicy(true)
;
Expand Down Expand Up @@ -103,7 +105,7 @@

it('policies index forbidden', function () {
MoonshineUser::query()->where('id', 1)->update([
'name' => 'Policies test'
'name' => 'Policies test',
]);

asAdmin()->get(
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Policies/ItemPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ItemPolicy

public function viewAny(MoonshineUser $user)
{
if($user->name === 'Policies test') {
if ($user->name === 'Policies test') {
return false;
}

Expand Down

0 comments on commit 6c8e8cc

Please sign in to comment.