zydnrbrn
zydnrbrn
FFilament
Created by Cristina on 10/18/2024 in #❓┊help
How have EditPage works both as modal and a page
yeahh sometime we can't totally implement reusable code on filament... as far as i know, but i think small effort for other necessary actions is doesn't matter to our target features right?
19 replies
FFilament
Created by Cristina on 10/18/2024 in #❓┊help
How have EditPage works both as modal and a page
No description
19 replies
FFilament
Created by Cristina on 10/18/2024 in #❓┊help
How have EditPage works both as modal and a page
that working on me, the example code is like this:
public static function getFormBannerSchema(): array
{
return [
Forms\Components\Select::make('parent_id')
->label('Parent Category')
->options(BannerCategory::all()->pluck('name', 'id'))
->searchable()
->nullable()
->columnSpan('full'),

Forms\Components\TextInput::make('name')
->required()
->maxLength(255)
->live(onBlur: true)
->afterStateUpdated(fn(string $operation, $state, Forms\Set $set) => $operation === 'create' ? $set('slug', Str::slug($state)) : null),

Forms\Components\TextInput::make('slug')
->disabled()
->dehydrated()
->required()
->maxLength(255)
->unique(BannerCategory::class, 'slug', ignoreRecord: true),

Forms\Components\MarkdownEditor::make('description')
->columnSpan('full'),

Forms\Components\Toggle::make('is_active')
->default(true),
];
}

public static function form(Form $form): Form
{
return $form
->schema(
self::getFormBannerSchema()
);
}
public static function getFormBannerSchema(): array
{
return [
Forms\Components\Select::make('parent_id')
->label('Parent Category')
->options(BannerCategory::all()->pluck('name', 'id'))
->searchable()
->nullable()
->columnSpan('full'),

Forms\Components\TextInput::make('name')
->required()
->maxLength(255)
->live(onBlur: true)
->afterStateUpdated(fn(string $operation, $state, Forms\Set $set) => $operation === 'create' ? $set('slug', Str::slug($state)) : null),

Forms\Components\TextInput::make('slug')
->disabled()
->dehydrated()
->required()
->maxLength(255)
->unique(BannerCategory::class, 'slug', ignoreRecord: true),

Forms\Components\MarkdownEditor::make('description')
->columnSpan('full'),

Forms\Components\Toggle::make('is_active')
->default(true),
];
}

public static function form(Form $form): Form
{
return $form
->schema(
self::getFormBannerSchema()
);
}
19 replies
FFilament
Created by Cristina on 10/18/2024 in #❓┊help
How have EditPage works both as modal and a page
but yeah the relationship will working as the Model defined correctly as like the resource
19 replies
FFilament
Created by Cristina on 10/18/2024 in #❓┊help
How have EditPage works both as modal and a page
has you been try static function for defining the form like this?
public static function getUserSchema(): array
{
return [
Forms\Components\TextInput::make('username)
->required,
];
}
public static function getUserSchema(): array
{
return [
Forms\Components\TextInput::make('username)
->required,
];
}
and then you call that on form() function on the resource and call in the modal form too
19 replies
FFilament
Created by gemini.dev on 10/13/2024 in #❓┊help
Add TextArea as a blade component
how about blade input but with same filament textarea styles? the code would be like this
<x-filament::input.wrapper>
<textarea
wire:model="name"
class="filament-input block w-full transition duration-75 rounded-lg shadow-sm focus:ring-primary-500 focus:border-primary-500 border-gray-300"
></textarea>
</x-filament::input.wrapper>
<x-filament::input.wrapper>
<textarea
wire:model="name"
class="filament-input block w-full transition duration-75 rounded-lg shadow-sm focus:ring-primary-500 focus:border-primary-500 border-gray-300"
></textarea>
</x-filament::input.wrapper>
3 replies
FFilament
Created by Cristina on 10/18/2024 in #❓┊help
How have EditPage works both as modal and a page
okayy i got it, and then you will call that edit modal in other page/resource with native filament modal right? but you don't want to define the form field again?
19 replies
FFilament
Created by Cristina on 10/18/2024 in #❓┊help
How have EditPage works both as modal and a page
or if you feel anoyying handling the relationship, have you been try relation manager? i think it will be helpful for you
19 replies
FFilament
Created by Cristina on 10/18/2024 in #❓┊help
How have EditPage works both as modal and a page
im agree with you, how about create a new livewire component, let say that is a form that can handle creating or edit? and then call that on the modal
19 replies
FFilament
Created by Cristina on 10/18/2024 in #❓┊help
How have EditPage works both as modal and a page
how about creating modal form with same field from EditPage or your resource?
19 replies
FFilament
Created by TegarJK on 10/18/2024 in #❓┊help
Is this memory usage normal?
11 replies
FFilament
Created by TegarJK on 10/18/2024 in #❓┊help
Is this memory usage normal?
windows very slow for running php code, just use wsl for dev if u still need windows
11 replies
FFilament
Created by TegarJK on 10/18/2024 in #❓┊help
Is this memory usage normal?
just use php artisan filament:optimize for caching the blade icons stuff and filament components
11 replies
FFilament
Created by zydnrbrn on 10/15/2024 in #❓┊help
State gone/refreshed on Custom Infolist Page when action clicked(Modal)
Solved, by using form components and then call that view Livewire
5 replies
FFilament
Created by zydnrbrn on 10/15/2024 in #❓┊help
State gone/refreshed on Custom Infolist Page when action clicked(Modal)
console didn't show any error when the state is missing
5 replies
FFilament
Created by zydnrbrn on 8/21/2024 in #❓┊help
Glitch or Flicker when typing in TextInput
on the video when i delete all number on quantity, and then typing again on that, the input is still on delete condition and then what i type on that just deleted by the column, effect from the blur i think?
3 replies
FFilament
Created by zydnrbrn on 7/31/2024 in #❓┊help
Combining with Inertia
no sir, i don't have any problem, i just wanna discuss 😅
6 replies
FFilament
Created by Xavi on 8/1/2024 in #❓┊help
Redirect after registration
it can handle via the controller sir
7 replies
FFilament
Created by mylanconnolly on 7/24/2024 in #❓┊help
Encountering poor performance in production after a number of troubleshooting steps
In other projects yes, but im not have been try with filament projects, but it worth to try
8 replies
FFilament
Created by mylanconnolly on 7/24/2024 in #❓┊help
Encountering poor performance in production after a number of troubleshooting steps
have you try using octane?
8 replies