Skip to content

Commit

Permalink
refactor: Remove helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to committed Jul 8, 2024
1 parent 13feb14 commit ee4560e
Showing 1 changed file with 1 addition and 34 deletions.
35 changes: 1 addition & 34 deletions src/UI/helpers.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?php

declare(strict_types=1);
use MoonShine\Support\Enums\FormMethod;

use MoonShine\UI\Applies\AppliesRegister;
use MoonShine\UI\Collections\Fields;
use MoonShine\UI\Components\ActionButton;
use MoonShine\UI\Components\FormBuilder;
use MoonShine\UI\Components\Table\TableBuilder;
use MoonShine\UI\Contracts\Collections\FieldsCollection;

if (! function_exists('appliesRegister')) {
Expand All @@ -28,33 +25,3 @@ function fieldsCollection(array $items = [], string $default = Fields::class): F
->getContainer(FieldsCollection::class, null, items: $items) ?? $default::make($items);
}
}

if (! function_exists('form')) {
function form(
string $action = '',
FormMethod $method = FormMethod::POST,
Fields|array $fields = [],
array $values = []
): FormBuilder {
return FormBuilder::make($action, $method, $fields, $values);
}
}

if (! function_exists('table')) {
function table(
Fields|array $fields = [],
iterable $items = [],
): TableBuilder {
return TableBuilder::make($fields, $items);
}
}

if (! function_exists('actionBtn')) {
function actionBtn(
Closure|string $label,
Closure|string $url = '',
mixed $item = null
): ActionButton {
return ActionButton::make($label, $url, $item);
}
}

0 comments on commit ee4560e

Please sign in to comment.