mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-19 21:04:44 +02:00

* Add Nullable * Edit filament & AppServiceProvider * Pint * Patch tests * Actually patching tests * Actually patching tests * Remove length * Remove defaultStringLength * Let’s see the differences --------- Co-authored-by: Lance Pioch <git@lance.sh>
47 lines
1.5 KiB
PHP
47 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\DatabaseResource\Pages;
|
|
|
|
use App\Filament\Resources\DatabaseResource;
|
|
use Filament\Forms\Form;
|
|
use Filament\Resources\Pages\CreateRecord;
|
|
use Filament\Forms;
|
|
|
|
class CreateDatabase extends CreateRecord
|
|
{
|
|
protected static string $resource = DatabaseResource::class;
|
|
|
|
public function form(Form $form): Form
|
|
{
|
|
return $form
|
|
->schema([
|
|
Forms\Components\Select::make('server_id')
|
|
->relationship('server', 'name')
|
|
->searchable()
|
|
->preload()
|
|
->required(),
|
|
Forms\Components\TextInput::make('database_host_id')
|
|
->required()
|
|
->numeric(),
|
|
Forms\Components\TextInput::make('database')
|
|
->required()
|
|
->maxLength(255),
|
|
Forms\Components\TextInput::make('remote')
|
|
->required()
|
|
->maxLength(255)
|
|
->default('%'),
|
|
Forms\Components\TextInput::make('username')
|
|
->required()
|
|
->maxLength(255),
|
|
Forms\Components\TextInput::make('password')
|
|
->password()
|
|
->revealable()
|
|
->required(),
|
|
Forms\Components\TextInput::make('max_connections')
|
|
->numeric()
|
|
->minValue(0)
|
|
->default(0),
|
|
]);
|
|
}
|
|
}
|