user()->hasAnyRole(['super_admin']); } public static function shouldRegisterNavigation(): bool { return auth()->user()->hasAnyRole(['super_admin']); } public ?array $data = []; public ?SchoolInformationModel $record = null; public function mount(): void { $this->record = SchoolInformationModel::firstOrNew(); $this->form->fill($this->record->toArray()); } public function form(Form $form): Form { return $form ->schema([ Grid::make(2)->schema([ TextInput::make('school_name')->label('Nama Sekolah')->required(), TextInput::make('npsn') ->label('NPSN') ->numeric() ->nullable(), TextInput::make('nss') ->label('NSS') ->nullable(), Textarea::make('address') ->label('Alamat Sekolah') ->nullable(), TextInput::make('postal_code') ->label('Kode Pos') ->numeric() ->nullable() ->default(null), TextInput::make('sub_district') ->label('Desa / Kelurahan') ->nullable(), TextInput::make('district') ->label('Kecamatan') ->nullable(), TextInput::make('city') ->label('Kota / Kabupaten') ->nullable(), TextInput::make('province') ->label('Provinsi') ->nullable(), TextInput::make('email') ->label('Email') ->nullable(), TextInput::make('headmaster_name') ->label('Nama Kepala Sekolah') ->nullable(), TextInput::make('headmaster_nip') ->label('NIP Kepala Sekolah') ->nullable(), TextInput::make('phase') ->label('Fase') ->nullable(), ]) ]) ->model($this->record) ->statePath('data'); } public function save(): void { $this->record->fill($this->data)->save(); Notification::make() ->title('Success') ->body('Data saved successfully.') ->success() ->send(); } }