Skip to content

Commit

Permalink
Dusting
Browse files Browse the repository at this point in the history
  • Loading branch information
marco76tv authored and actions-user committed Jan 9, 2024
1 parent f7c4e29 commit 7075120
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Filament/Blocks/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static function make(
TextInput::make('caption')
->columnSpanFull(),
])
->columns('form' === $context ? 2 : 1);
->columns($context === 'form' ? 2 : 1);
}

public static function getRatios(): array
Expand Down
2 changes: 1 addition & 1 deletion Filament/Blocks/PageCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ public static function make(
->label('Link text (optional)'),
])
->label('Link to page')
->columns('form' === $context ? 2 : 1);
->columns($context === 'form' ? 2 : 1);
}
}
2 changes: 1 addition & 1 deletion Filament/Blocks/PostCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ public static function make(
->label('Link text (optional)'),
])
->label('Link to post')
->columns('form' === $context ? 2 : 1);
->columns($context === 'form' ? 2 : 1);
}
}
2 changes: 1 addition & 1 deletion Filament/Blocks/Title.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public static function make(
])
->afterStateHydrated(static fn ($state, $set) => $state || $set('level', 'h2')),
])
->columns('form' === $context ? 2 : 1);
->columns($context === 'form' ? 2 : 1);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function storeChildItem(Model $record, array $data): void
$last_son = $record::class::where('parent_id', $data['parent_id'])
->orderByDesc('id')
->first();
if (null == $last_son) {
if ($last_son == null) {
$data['id'] = $data['parent_id'].'-1';
} else {
$new_id = intval(Str::afterLast($last_son['id'], '-')) + 1;
Expand Down Expand Up @@ -202,7 +202,7 @@ protected function getHeaderActions(): array
}
})
->requiresConfirmation()
->visible(null != $this->mountedItem),
->visible($this->mountedItem != null),
Action::make('item')
->mountUsing(function (ComponentContainer $form): void {
if (! $this->mountedItem) {
Expand Down
4 changes: 2 additions & 2 deletions View/Components/Render/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ public function render(): Renderable
$this->tpl = $this->block['type'];

$views = ['ui::components.blocks.'.$this->tpl];
if (null !== $this->model) {
if ($this->model !== null) {
$module = app(GetModuleNameFromModelAction::class)->execute($this->model);
$views[] = strtolower($module).'::components.blocks.'.$this->tpl;
}

$view = Arr::first($views, static fn (string $view) => view()->exists($view));
if (null === $view) {
if ($view === null) {
dddx([$views, $this->model]);
}
$view_params = $this->block['data'] ?? [];
Expand Down

0 comments on commit 7075120

Please sign in to comment.