nyannss
nyannss
FFilament
Created by nyannss on 5/30/2024 in #❓┊help
Get Relation Fieldset State / Set Outside State in Relationship Fieldset
Yes, it is. Thanks for your help! Turns out it's like a folder path, i just realised that too.
24 replies
FFilament
Created by nyannss on 5/30/2024 in #❓┊help
Get Relation Fieldset State / Set Outside State in Relationship Fieldset
Thats what i think 👌
24 replies
FFilament
Created by nyannss on 5/30/2024 in #❓┊help
Get Relation Fieldset State / Set Outside State in Relationship Fieldset
Forgot to delete, thanks for reminding.
24 replies
FFilament
Created by nyannss on 5/30/2024 in #❓┊help
Get Relation Fieldset State / Set Outside State in Relationship Fieldset
Fieldset::make('Konten Halaman')->schema([
TextInput::make('title')
->required(),

TextInput::make('meta_desc')
->required(),

MarkdownEditor::make('content')
->required()
->columnSpan('full'),

TextInput::make('desc_nurse')
->label("Deskripsi Singkat")
->required()
->columnSpan('full'),

TextInput::make('slug')
->prefix(config('app.url') . "/profile/")
->unique(Nurse::class, 'slug', fn($record) => $record)
->columnSpan('full'),
])
Fieldset::make('Konten Halaman')->schema([
TextInput::make('title')
->required(),

TextInput::make('meta_desc')
->required(),

MarkdownEditor::make('content')
->required()
->columnSpan('full'),

TextInput::make('desc_nurse')
->label("Deskripsi Singkat")
->required()
->columnSpan('full'),

TextInput::make('slug')
->prefix(config('app.url') . "/profile/")
->unique(Nurse::class, 'slug', fn($record) => $record)
->columnSpan('full'),
])
24 replies
FFilament
Created by nyannss on 5/30/2024 in #❓┊help
Get Relation Fieldset State / Set Outside State in Relationship Fieldset
Fieldset::make('User Data')
->relationship('user')
->schema([
TextInput::make('name')
->reactive()
->live()
->required()
->afterStateUpdated(fn(?string $state, Set $set) => $set('slug', Str::slug($state))),
TextInput::make('email')
->email(),
TextInput::make('password')
->required(fn(string $operation) => $operation == "create")
->password()
->dehydrateStateUsing(fn(string $state): string => Hash::make($state))
->dehydrated(fn(?string $state): bool => filled($state))
->confirmed(),
TextInput::make('password_confirmation')
->required(fn(string $operation) => $operation == "create")
->password(),
FileUpload::make('profile_image_url')
->label("Foto Profil")
->directory(fn(callable $get) => '/profile-image/' . Str::slug($get('name')))
->getUploadedFileNameForStorageUsing(
fn(TemporaryUploadedFile $file): string => (string)str(time() . Str::random(14) . "." . $file->getClientOriginalExtension())
->prepend('image-'),
)
->image()
->storeFileNamesIn('/assets/images/services')
->imageCropAspectRatio("1:1")
->imageEditor()
->maxSize(1000)
->columnSpan('full')
]),
Fieldset::make('User Data')
->relationship('user')
->schema([
TextInput::make('name')
->reactive()
->live()
->required()
->afterStateUpdated(fn(?string $state, Set $set) => $set('slug', Str::slug($state))),
TextInput::make('email')
->email(),
TextInput::make('password')
->required(fn(string $operation) => $operation == "create")
->password()
->dehydrateStateUsing(fn(string $state): string => Hash::make($state))
->dehydrated(fn(?string $state): bool => filled($state))
->confirmed(),
TextInput::make('password_confirmation')
->required(fn(string $operation) => $operation == "create")
->password(),
FileUpload::make('profile_image_url')
->label("Foto Profil")
->directory(fn(callable $get) => '/profile-image/' . Str::slug($get('name')))
->getUploadedFileNameForStorageUsing(
fn(TemporaryUploadedFile $file): string => (string)str(time() . Str::random(14) . "." . $file->getClientOriginalExtension())
->prepend('image-'),
)
->image()
->storeFileNamesIn('/assets/images/services')
->imageCropAspectRatio("1:1")
->imageEditor()
->maxSize(1000)
->columnSpan('full')
]),
24 replies
FFilament
Created by nyannss on 5/30/2024 in #❓┊help
Get Relation Fieldset State / Set Outside State in Relationship Fieldset
24 replies
FFilament
Created by nyannss on 5/30/2024 in #❓┊help
Get Relation Fieldset State / Set Outside State in Relationship Fieldset
Tried, nothing happens.
24 replies
FFilament
Created by nyannss on 5/30/2024 in #❓┊help
Get Relation Fieldset State / Set Outside State in Relationship Fieldset
Isn't "callable" just for ide helper?
24 replies
FFilament
Created by nyannss on 5/30/2024 in #❓┊help
Get Relation Fieldset State / Set Outside State in Relationship Fieldset
Nah. I have one to one relationship, I want edit in one form. Lets say table users have name column and the nurses table have slug column. Like in example (https://filamentphp.com/docs/3.x/forms/advanced#generating-a-slug-from-a-title), when edit name, will automatically update slug value.
24 replies
FFilament
Created by nyannss on 5/14/2024 in #❓┊help
Ignore null values save to database and create custom confirmation text
Thank you so much
9 replies
FFilament
Created by nyannss on 5/14/2024 in #❓┊help
Ignore null values save to database and create custom confirmation text
No description
9 replies
FFilament
Created by nyannss on 5/14/2024 in #❓┊help
Ignore null values save to database and create custom confirmation text
No description
9 replies