Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
marco76tv committed Aug 19, 2024
1 parent 7cddc2a commit 12eb5bc
Show file tree
Hide file tree
Showing 24 changed files with 62 additions and 72 deletions.
10 changes: 5 additions & 5 deletions Actions/Block/GetAllBlocksAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ public function execute(string $context = 'form'): DataCollection
$blocks = Arr::map($files,
function ($path) {
$class = Str::of($path)
->after(base_path('Modules'))
->prepend('\Modules')
->before('.php')
->replace('/', '\\')
->toString();
->after(base_path('Modules'))
->prepend('\Modules')
->before('.php')
->replace('/', '\\')
->toString();

$name = Str::of(class_basename($class))->snake()->toString();
if (Str::endsWith($name, '_block')) {
Expand Down
2 changes: 1 addition & 1 deletion Actions/Icon/GetAllIconsAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function execute(string $context = 'form')
foreach ($set['paths'] as $path) {
foreach (File::allFiles($path) as $file) {
// Simply ignore files that aren't SVGs
if ('svg' !== $file->getExtension()) {
if ($file->getExtension() !== 'svg') {
continue;
}

Expand Down
3 changes: 1 addition & 2 deletions Datas/SliderDataCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ class SliderDataCollection extends Data
public DataCollection $slider_data;

public function __construct(
) {
}
) {}
}
2 changes: 1 addition & 1 deletion Enums/CornerPositionEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Filament\Support\Contracts\HasIcon;
use Filament\Support\Contracts\HasLabel;

enum CornerPositionEnum: string implements HasLabel, HasColor, HasIcon
enum CornerPositionEnum: string implements HasColor, HasIcon, HasLabel
{
case TOP_LEFT = 'top-left';
case TOP_RIGHT = 'top-right';
Expand Down
6 changes: 3 additions & 3 deletions Enums/TableLayoutEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Filament\Support\Contracts\HasLabel;
use Illuminate\Support\Arr;

enum TableLayoutEnum: string implements HasLabel, HasColor, HasIcon
enum TableLayoutEnum: string implements HasColor, HasIcon, HasLabel
{
case GRID = 'grid';
case LIST = 'list';
Expand Down Expand Up @@ -50,14 +50,14 @@ public function getIcon(): ?string
public function toggle(): self
{
// $res = self::LIST === $this ? self::GRID : self::LIST;
$res = self::GRID === $this ? self::LIST : self::GRID;
$res = $this === self::GRID ? self::LIST : self::GRID;

return $res;
}

public function isGridLayout(): bool
{
return self::GRID === $this;
return $this === self::GRID;
}

public function getTableContentGrid(): ?array
Expand Down
5 changes: 3 additions & 2 deletions Filament/Actions/Header/TableLayoutToggleHeaderAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class TableLayoutToggleHeaderAction extends Action
{
// use NavigationActionLabelTrait;
public string $list_icon = 'heroicon-o-list-bullet';

public string $grid_icon = 'heroicon-o-squares-2x2';

public static function getDefaultName(): ?string
Expand All @@ -30,10 +31,10 @@ protected function setUp(): void
// ->tooltip(trans('setting::database_connection.actions.database-backup.tooltip'))
// ->icon(trans('setting::database_connection.actions.database-backup.icon'))
// ->icon($this->list_icon)
->icon(fn ($livewire) => 'list' == $livewire->layoutView ? $this->list_icon : $this->grid_icon)
->icon(fn ($livewire) => $livewire->layoutView == 'list' ? $this->list_icon : $this->grid_icon)
->action(
function ($livewire) {
$livewire->layoutView = ('grid' == $livewire->layoutView ? 'list' : 'grid');
$livewire->layoutView = ($livewire->layoutView == 'grid' ? 'list' : 'grid');
}
);
}
Expand Down
2 changes: 1 addition & 1 deletion Filament/Blocks/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static function make(
->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/ImageSpatie.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ function (HasForms $livewire, SpatieMediaLibraryFileUpload $component, Temporary
TextInput::make('caption')
->label('didascalia'),
])
->columns('form' === $context ? 2 : 1);
->columns($context === 'form' ? 2 : 1);
}
}
16 changes: 8 additions & 8 deletions Filament/Blocks/ImagesGallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ public static function make(
SpatieMediaLibraryFileUpload::make('image')
// ->image()
// ->maxSize(5000)
->multiple()
->enableReordering()
->openable()
->downloadable()
->columnSpanFull()
->multiple()
->enableReordering()
->openable()
->downloadable()
->columnSpanFull()
// ->collection('avatars')
// ->conversion('thumbnail')
->disk('uploads')
->directory('photos'),
->disk('uploads')
->directory('photos'),

TextInput::make('title')
->columnSpanFull(),
Expand Down Expand Up @@ -76,7 +76,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/Slider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public static function make(
// ->afterStateHydrated(static fn ($state, $set) => $state || $set('level', 'h2')),
]
)
->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 @@ -39,6 +39,6 @@ public static function make(
->options($views),
]
)
->columns('form' === $context ? 2 : 1);
->columns($context === 'form' ? 2 : 1);
}
}
2 changes: 1 addition & 1 deletion Filament/Blocks/VideoSpatie.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function (HasForms $livewire, SpatieMediaLibraryFileUpload $component, Temporary

// Forms\Components\SpatieMediaLibraryFileUpload::make('media_id')
])
->columns('form' === $context ? 2 : 1);
->columns($context === 'form' ? 2 : 1);
}

public static function getRatios(): array
Expand Down
4 changes: 2 additions & 2 deletions Filament/Forms/Components/AddressField.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function saveRelationships(): void
$record = $this->getRecord();
$relationship = $record?->{$this->getRelationship()}();

if (null === $relationship) {
if ($relationship === null) {
return;
} elseif ($address = $relationship->first()) {
$address->update($state);
Expand Down Expand Up @@ -80,7 +80,7 @@ protected function setUp(): void
'zip' => null,
];
$address = $record?->getRelationValue($this->getRelationship());
if (null != $address && is_object($address) && method_exists($address, 'toArray')) {
if ($address != null && is_object($address) && method_exists($address, 'toArray')) {
$data = $address->toArray();
}

Expand Down
46 changes: 23 additions & 23 deletions Filament/Forms/Components/IconPicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,31 @@ protected function setUp(): void

$this->suffixAction(
\Filament\Forms\Components\Actions\Action::make('icon')
->icon(fn (?string $state) => $state)
->icon(fn (?string $state) => $state)
// ->modalContent(fn ($record) => view('ui::filament.forms.components.icon-picker', ['record' => $record]))
->form([
Select::make('pack')
->options($packs)
->reactive()
->live(),
RadioIcon::make('newstate')
->options(function (Get $get) use ($icons): array {
$pack = $get('pack');
if (null == $pack) {
return [];
}
$key = $pack.'.icons';
Assert::isArray($opts = Arr::get($icons, $key, []), '['.__LINE__.']['.__FILE__.']');
$opts = array_combine($opts, $opts);
->form([
Select::make('pack')
->options($packs)
->reactive()
->live(),
RadioIcon::make('newstate')
->options(function (Get $get) use ($icons): array {
$pack = $get('pack');
if ($pack == null) {
return [];
}
$key = $pack.'.icons';
Assert::isArray($opts = Arr::get($icons, $key, []), '['.__LINE__.']['.__FILE__.']');
$opts = array_combine($opts, $opts);

return $opts;
})
->inline()
->inlineLabel(false),
])
->action(function ($data, $set) {
$set('icon', $data['newstate']);
})
return $opts;
})
->inline()
->inlineLabel(false),
])
->action(function ($data, $set) {
$set('icon', $data['newstate']);
})
);
}
}
4 changes: 1 addition & 3 deletions Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,5 @@ class EventServiceProvider extends BaseEventServiceProvider
/**
* Configure the proper event listeners for email verification.
*/
protected function configureEmailVerification(): void
{
}
protected function configureEmailVerification(): void {}
}
3 changes: 1 addition & 2 deletions View/Components/BreadLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ public function __construct(
// public Post $article,
// public bool $showAuthor = false,
public string $tpl = 'v1'
) {
}
) {}

public function render(): Renderable
{
Expand Down
3 changes: 1 addition & 2 deletions View/Components/Logo.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ public function __construct(
// public Post $article,
// public bool $showAuthor = false,
public string $tpl = 'v1'
) {
}
) {}

public function render(): Renderable
{
Expand Down
3 changes: 1 addition & 2 deletions View/Components/Navbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ public function __construct(
// public Post $article,
// public bool $showAuthor = false,
// public string $tpl = 'v1'
) {
}
) {}

public function render(): Renderable
{
Expand Down
3 changes: 1 addition & 2 deletions View/Components/Page/WithSidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ public function __construct(
// public Post $article,
// public bool $showAuthor = false,
public string $tpl = 'v1'
) {
}
) {}

public function render(): Renderable
{
Expand Down
2 changes: 1 addition & 1 deletion View/Components/Render/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function render(): ViewFactory|View
return view('ui::empty');
}

if ('v1' === $this->tpl) {
if ($this->tpl === 'v1') {
$this->tpl = $this->block['type'];
} else {
$this->tpl = $this->block['type'].'.'.$this->tpl;
Expand Down
3 changes: 1 addition & 2 deletions View/Components/Sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ class Sidebar extends Component
public function __construct(
public Collection $collection,
// public string $tpl = 'v1'
) {
}
) {}

/**
* Get the view / contents that represent the component.
Expand Down
3 changes: 1 addition & 2 deletions View/Components/Std.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ public function __construct(
// public Post $article,
// public bool $showAuthor = false,
public string $tpl = 'v1'
) {
}
) {}

public function render(): Renderable
{
Expand Down
3 changes: 1 addition & 2 deletions View/Components/Svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ public function __construct(
// public Post $article,
// public bool $showAuthor = false,
public string $tpl = 'v1'
) {
}
) {}

public function render(): Renderable
{
Expand Down
3 changes: 1 addition & 2 deletions View/Composers/ThemeComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ public function metatags(): \Illuminate\View\View
}

/**
* @param string $index
*
* @param string $index
* @return \Illuminate\Config\Repository|\Illuminate\Contracts\Foundation\Application|mixed
*/
public function metatag($index)
Expand Down

0 comments on commit 12eb5bc

Please sign in to comment.