Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Refactor form components

Andras Bacsai657c7d8cff37
diff --git a/app/View/Components/Forms/Input.php b/app/View/Components/Forms/Input.php
index 09cee0338b..93598cea5c 100644
--- a/app/View/Components/Forms/Input.php
+++ b/app/View/Components/Forms/Input.php
@@ -10,17 +10,17 @@ use Visus\Cuid2\Cuid2;
class Input extends Component
{
public function __construct(
- public string|null $id = null,
- public string|null $name = null,
- public string|null $type = 'text',
- public string|null $value = null,
- public string|null $label = null,
- public bool $required = false,
- public bool $disabled = false,
- public bool $readonly = false,
- public string|null $helper = null,
- public bool $allowToPeak = true,
- public string $defaultClass = "input input-sm bg-coolgray-100 rounded text-white w-full disabled:bg-coolgray-200/50 disabled:border-none placeholder:text-coolgray-500 read-only:text-neutral-500 read-only:bg-coolgray-200/50"
+ public ?string $id = null,
+ public ?string $name = null,
+ public ?string $type = 'text',
+ public ?string $value = null,
+ public ?string $label = null,
+ public bool $required = false,
+ public bool $disabled = false,
+ public bool $readonly = false,
+ public ?string $helper = null,
+ public bool $allowToPeak = true,
+ public string $defaultClass = "input input-sm bg-coolgray-100 rounded text-white w-full disabled:bg-coolgray-200/50 disabled:border-none placeholder:text-coolgray-500 read-only:text-neutral-500 read-only:bg-coolgray-200/50"
) {
}
diff --git a/app/View/Components/Forms/Textarea.php b/app/View/Components/Forms/Textarea.php
index 50ffe77f79..aa8d874ad2 100644
--- a/app/View/Components/Forms/Textarea.php
+++ b/app/View/Components/Forms/Textarea.php
@@ -4,7 +4,6 @@ namespace App\View\Components\Forms;
use Closure;
use Illuminate\Contracts\View\View;
-use Illuminate\Support\Str;
use Illuminate\View\Component;
use Visus\Cuid2\Cuid2;
@@ -14,18 +13,19 @@ class Textarea extends Component
* Create a new component instance.
*/
public function __construct(
- public string|null $id = null,
- public string|null $name = null,
- public string|null $type = 'text',
- public string|null $value = null,
- public string|null $label = null,
- public string|null $placeholder = null,
- public bool $required = false,
- public bool $disabled = false,
- public bool $readonly = false,
- public string|null $helper = null,
- public bool $realtimeValidation = false,
- public string $defaultClass = "textarea leading-normal bg-coolgray-100 rounded text-white scrollbar disabled:bg-coolgray-200/50 disabled:border-none placeholder:text-coolgray-500 read-only:text-neutral-500 read-only:bg-coolgray-200/50"
+ public ?string $id = null,
+ public ?string $name = null,
+ public ?string $type = 'text',
+ public ?string $value = null,
+ public ?string $label = null,
+ public ?string $placeholder = null,
+ public bool $required = false,
+ public bool $disabled = false,
+ public bool $readonly = false,
+ public ?string $helper = null,
+ public bool $realtimeValidation = false,
+ // public bool $allowToPeak = true,
+ public string $defaultClass = "textarea leading-normal bg-coolgray-100 rounded text-white scrollbar disabled:bg-coolgray-200/50 disabled:border-none placeholder:text-coolgray-500 read-only:text-neutral-500 read-only:bg-coolgray-200/50"
) {
//
}