2024-03-24 01:48:03 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Filament\Resources\DatabaseResource\Pages;
|
|
|
|
|
|
|
|
|
|
use App\Filament\Resources\DatabaseResource;
|
2024-06-29 17:38:18 -04:00
|
|
|
use Filament\Forms\Components\Select;
|
|
|
|
|
use Filament\Forms\Components\TextInput;
|
2024-04-23 19:45:11 -04:00
|
|
|
use Filament\Forms\Form;
|
2024-03-24 01:48:03 -04:00
|
|
|
use Filament\Resources\Pages\CreateRecord;
|
|
|
|
|
|
|
|
|
|
class CreateDatabase extends CreateRecord
|
|
|
|
|
{
|
|
|
|
|
protected static string $resource = DatabaseResource::class;
|
2024-04-23 19:45:11 -04:00
|
|
|
|
|
|
|
|
public function form(Form $form): Form
|
|
|
|
|
{
|
|
|
|
|
return $form
|
|
|
|
|
->schema([
|
2024-06-29 17:38:18 -04:00
|
|
|
Select::make('server_id')
|
2024-04-23 19:45:11 -04:00
|
|
|
->relationship('server', 'name')
|
|
|
|
|
->searchable()
|
|
|
|
|
->preload()
|
|
|
|
|
->required(),
|
2024-06-29 17:38:18 -04:00
|
|
|
TextInput::make('database_host_id')
|
2024-04-23 19:45:11 -04:00
|
|
|
->required()
|
|
|
|
|
->numeric(),
|
2024-06-29 17:38:18 -04:00
|
|
|
TextInput::make('database')
|
2024-04-23 19:45:11 -04:00
|
|
|
->required()
|
2024-06-16 19:56:18 +02:00
|
|
|
->maxLength(255),
|
2024-06-29 17:38:18 -04:00
|
|
|
TextInput::make('remote')
|
2024-04-23 19:45:11 -04:00
|
|
|
->required()
|
2024-06-16 19:56:18 +02:00
|
|
|
->maxLength(255)
|
2024-04-23 19:45:11 -04:00
|
|
|
->default('%'),
|
2024-06-29 17:38:18 -04:00
|
|
|
TextInput::make('username')
|
2024-04-23 19:45:11 -04:00
|
|
|
->required()
|
2024-06-16 19:56:18 +02:00
|
|
|
->maxLength(255),
|
2024-06-29 17:38:18 -04:00
|
|
|
TextInput::make('password')
|
2024-04-23 19:45:11 -04:00
|
|
|
->password()
|
|
|
|
|
->revealable()
|
|
|
|
|
->required(),
|
2024-06-29 17:38:18 -04:00
|
|
|
TextInput::make('max_connections')
|
2024-04-23 19:45:11 -04:00
|
|
|
->numeric()
|
|
|
|
|
->minValue(0)
|
|
|
|
|
->default(0),
|
|
|
|
|
]);
|
|
|
|
|
}
|
2024-03-24 01:48:03 -04:00
|
|
|
}
|