<?php

namespace App\Filament\Resources\Etablissements\Schemas;

use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema;

class EtablissementForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextInput::make('libellear')
                    ->required(),
                TextInput::make('libellefr')
                    ->required(),
                Select::make('cycle_id')
                    ->relationship('cycle', 'id')
                    ->required(),
                Select::make('commune_id')
                    ->relationship('commune', 'id')
                    ->required(),
                TextInput::make('code')
                    ->required(),
                TextInput::make('latitude')
                    ->numeric()
                    ->default(null),
                TextInput::make('longitude')
                    ->numeric()
                    ->default(null),
                TextInput::make('date_creation')
                    ->required(),
            ]);
    }
}
