From 27f05b5f955029d5f56a81d3df921c71c6fd013e Mon Sep 17 00:00:00 2001 From: Lance Pioch Date: Thu, 11 Apr 2024 11:31:38 -0400 Subject: [PATCH] Expand text area to make it look nicer --- app/Filament/Resources/ServerResource.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Filament/Resources/ServerResource.php b/app/Filament/Resources/ServerResource.php index 3e972e2ad..1a75be7e6 100644 --- a/app/Filament/Resources/ServerResource.php +++ b/app/Filament/Resources/ServerResource.php @@ -230,10 +230,14 @@ class ServerResource extends Resource Forms\Components\Textarea::make('startup') ->label('Startup Command') ->required() - ->rows(1) + ->live() + ->rows(function ($state) { + return str($state)->explode("\n")->reduce(fn (int $carry, $line) + => $carry + floor(strlen($line) / 125), + 0); + }) ->columnSpanFull(), - Forms\Components\Repeater::make('s') ->reorderable(false) ->addable(false)