Gush
Gush
FFilament
Created by Gush on 6/13/2024 in #❓┊help
CreateAnother Button closing modal
->extraModalFooterActions(fn (Action $action): array => [
$action->makeModalSubmitAction('createAnother', arguments: ['another' => true]),
])
->extraModalFooterActions(fn (Action $action): array => [
$action->makeModalSubmitAction('createAnother', arguments: ['another' => true]),
])
how can i prevent this from closing modal?
7 replies
FFilament
Created by Gush on 6/7/2024 in #❓┊help
SuffixActions not Sticking to top
No description
5 replies
FFilament
Created by Gush on 5/29/2024 in #❓┊help
Position row action before columns
Filament has in the docs a way to position all actions before columns but what if i only want to position certain action before columns? https://filamentphp.com/docs/3.x/tables/actions#positioning-row-actions-before-the-checkbox-column
7 replies
FFilament
Created by Gush on 5/24/2024 in #❓┊help
How to work with State as a array?
No description
7 replies
FFilament
Created by Gush on 5/21/2024 in #❓┊help
Following laracast lesson on custom form field
How do i manage two inputs then? if i x-model with state
3 replies
FFilament
Created by Gush on 5/15/2024 in #❓┊help
Alpine component broke filament create button
I made a custom form field component, put some alpine inside and now my create button doesnt work
11 replies
FFilament
Created by Gush on 3/12/2024 in #❓┊help
Button to create model in other resources
Hey, im looking for a way to have a Action on a resource that is a create of the expecific model i want
6 replies
FFilament
Created by Gush on 3/8/2024 in #❓┊help
Select All option in relationship Select
Hey, i have a Select with relationship users, works fine but i would like a option to select all users at one
Select::make('user_id')
->multiple()
->native(false)
->searchable()
->preload()
->label(__('nlmn-event-module::scheduling.scheduling_resource.event_participants'))
->relationship('users', 'name'),
Select::make('user_id')
->multiple()
->native(false)
->searchable()
->preload()
->label(__('nlmn-event-module::scheduling.scheduling_resource.event_participants'))
->relationship('users', 'name'),
3 replies
FFilament
Created by Gush on 1/31/2024 in #❓┊help
Select with relationship default
Select::make('customer_group_id')
->label(__('nlmn-customer-module::customer.customer_resource.customer_group_id'))
->relationship('customer_group', 'name')
->preload()
->multiple()
->searchable()
->native(false),
Select::make('customer_group_id')
->label(__('nlmn-customer-module::customer.customer_resource.customer_group_id'))
->relationship('customer_group', 'name')
->preload()
->multiple()
->searchable()
->native(false),
How do i say i want the default group to be "geral" that has ID 1
4 replies
FFilament
Created by Gush on 1/31/2024 in #❓┊help
Separate Filters from table
Is it possible to separate the table filters out of the table?
3 replies
FFilament
Created by Gush on 1/16/2024 in #❓┊help
visible on select
i had a toggle form for this visable but now i want to do it with a select so that if id 2 or 3 of the related table is selected the tab is visible, i appreciate any help
Tabs\Tab::make(__('nlmn-customer-module::customer.customer_resource.company_details'))
->icon('heroicon-m-building-office-2')
->schema([
Select::make('company_entity_type')
->label(__('nlmn-customer-module::customer.customer_resource.entity_type'))
->relationship('customer_type', 'name')
->native(false)
->live()
->required(),
TextInput::make('company_cae')
->label('CAE'),
Select::make('company_sector_activity_id')
->label(__('nlmn-customer-module::customer.customer_resource.activity_sector'))
->preload()
->searchable()
->native(false)
->relationship('sector_activities', 'name'),
TextInput::make('company_employee_count')
->label(__('nlmn-customer-module::customer.customer_resource.employee_count'))
->numeric(),
TextInput::make('company_foundation_year')
->label(__('nlmn-customer-module::customer.customer_resource.foundation_year'))
->numeric()
->placeholder('2023'),
])->columns(2)->visible(fn (Get $get): bool => $get('is_company')),
Tabs\Tab::make(__('nlmn-customer-module::customer.customer_resource.company_details'))
->icon('heroicon-m-building-office-2')
->schema([
Select::make('company_entity_type')
->label(__('nlmn-customer-module::customer.customer_resource.entity_type'))
->relationship('customer_type', 'name')
->native(false)
->live()
->required(),
TextInput::make('company_cae')
->label('CAE'),
Select::make('company_sector_activity_id')
->label(__('nlmn-customer-module::customer.customer_resource.activity_sector'))
->preload()
->searchable()
->native(false)
->relationship('sector_activities', 'name'),
TextInput::make('company_employee_count')
->label(__('nlmn-customer-module::customer.customer_resource.employee_count'))
->numeric(),
TextInput::make('company_foundation_year')
->label(__('nlmn-customer-module::customer.customer_resource.foundation_year'))
->numeric()
->placeholder('2023'),
])->columns(2)->visible(fn (Get $get): bool => $get('is_company')),
2 replies
FFilament
Created by Gush on 1/16/2024 in #❓┊help
Form Tabs
No description
4 replies
FFilament
Created by Gush on 12/20/2023 in #❓┊help
big database select options not founding result
Hello, im trying to do a form with country, state, city selects, the first two work fine since are much less results but my city select form cant seem to work after certain countries down the list here is my code, i tried both ways
// Forms\Components\Select::make('city_id')
// ->label('City')
// ->options(fn (Get $get): Collection => City::query()
// ->where('state_id', $get('state_id'))
// ->pluck('name', 'id'))
// ->searchable()
// // ->preload()
// ->live()
// ->required(),
Forms\Components\Select::make('city_id')
->label('City')
->getSearchResultsUsing(fn (Get $get): array => City::where('state_id', $get('state_id'))->pluck('name', 'id')->toArray())
->getOptionLabelUsing(fn ($value): ?string => City::find($value)?->name)
->preload()
->searchable()
->live()
->required(),
// Forms\Components\Select::make('city_id')
// ->label('City')
// ->options(fn (Get $get): Collection => City::query()
// ->where('state_id', $get('state_id'))
// ->pluck('name', 'id'))
// ->searchable()
// // ->preload()
// ->live()
// ->required(),
Forms\Components\Select::make('city_id')
->label('City')
->getSearchResultsUsing(fn (Get $get): array => City::where('state_id', $get('state_id'))->pluck('name', 'id')->toArray())
->getOptionLabelUsing(fn ($value): ?string => City::find($value)?->name)
->preload()
->searchable()
->live()
->required(),
3 replies
FFilament
Created by Gush on 12/18/2023 in #❓┊help
Adminpanel settings change in App
hello all, i need help understanding how can i dynamicly change a configuration in Adminpanel my example is
->passwordReset() and i want to have a toggle form to change this to either true or false what would be the best approach? Thank you
10 replies
FFilament
Created by Gush on 11/22/2023 in #❓┊help
EloquentQuery on CustomPage
Hey, so i do know that in resources you can change the query constraints that show in the resource via
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()->where('is_active', true);
}
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()->where('is_active', true);
}
but it doesnt work on custom page
2 replies
FFilament
Created by Gush on 11/21/2023 in #❓┊help
table layout without removing the column names row?
Hey, is there a way i can keep the column names above the table like the traditional filament table without the split
public static function table(Table $table): Table
{
return $table
->columns([
Split::make([
TextColumn::make('name')
->label(__('construction.construction_resource.name'))
->sortable()
->searchable(),
TextColumn::make('address')
->label(__('construction.construction_resource.address'))
->sortable()
->searchable(),
TextColumn::make('landmark')
->label(__('construction.construction_resource.landmark'))
->sortable()
->searchable(),
TextColumn::make('gps_coordinates')
->sortable()
->searchable()
->label(__('construction.construction_resource.gps_coordinates')),
TextColumn::make('peak_power')
->searchable()
->sortable()
->label(__('construction.construction_resource.peak_power')),
TextColumn::make('nominal_power')
->searchable()
->sortable()
->label(__('construction.construction_resource.nominal_power')),
TextColumn::make('customers.name')
->label(__('construction.construction_resource.customer'))
->placeholder(__('construction.construction_resource.placeholder'))
->sortable()
->searchable(),
TextColumn::make('created_at')
->toggleable(isToggledHiddenByDefault: true)
->label(__('construction.construction_resource.created_at')),
TextColumn::make('user.name')
->toggleable(isToggledHiddenByDefault: true)
->label(__('construction.construction_resource.created_by'))
->searchable(),
]),
Panel::make([
Stack::make([
TextColumn::make('responsible_name')
->placeholder('Não Definido')
->searchable()
->icon('heroicon-m-user'),
TextColumn::make('responsible_contact')
->placeholder('Não Definido')
->searchable()
->icon('heroicon-m-phone'),
TextColumn::make('responsible_email')
->placeholder('Não Definido')
->searchable()
->icon('heroicon-m-envelope'),
]),
])->collapsible(),
])
public static function table(Table $table): Table
{
return $table
->columns([
Split::make([
TextColumn::make('name')
->label(__('construction.construction_resource.name'))
->sortable()
->searchable(),
TextColumn::make('address')
->label(__('construction.construction_resource.address'))
->sortable()
->searchable(),
TextColumn::make('landmark')
->label(__('construction.construction_resource.landmark'))
->sortable()
->searchable(),
TextColumn::make('gps_coordinates')
->sortable()
->searchable()
->label(__('construction.construction_resource.gps_coordinates')),
TextColumn::make('peak_power')
->searchable()
->sortable()
->label(__('construction.construction_resource.peak_power')),
TextColumn::make('nominal_power')
->searchable()
->sortable()
->label(__('construction.construction_resource.nominal_power')),
TextColumn::make('customers.name')
->label(__('construction.construction_resource.customer'))
->placeholder(__('construction.construction_resource.placeholder'))
->sortable()
->searchable(),
TextColumn::make('created_at')
->toggleable(isToggledHiddenByDefault: true)
->label(__('construction.construction_resource.created_at')),
TextColumn::make('user.name')
->toggleable(isToggledHiddenByDefault: true)
->label(__('construction.construction_resource.created_by'))
->searchable(),
]),
Panel::make([
Stack::make([
TextColumn::make('responsible_name')
->placeholder('Não Definido')
->searchable()
->icon('heroicon-m-user'),
TextColumn::make('responsible_contact')
->placeholder('Não Definido')
->searchable()
->icon('heroicon-m-phone'),
TextColumn::make('responsible_email')
->placeholder('Não Definido')
->searchable()
->icon('heroicon-m-envelope'),
]),
])->collapsible(),
])
2 replies
FFilament
Created by Gush on 11/21/2023 in #❓┊help
get select record on relation manager attach form
Hey, i need help understanding how do i get the equipment id i selected on form in order to make a custom rule checking for existing records with the same equipment_id and serial_number here is the code
->rule(static function (Forms\Get $get, Forms\Components\Component $component): Closure {
return static function (string $attribute, $value, Closure $fail) use ($get, $component) {

$equipmentID = ;

$existingRecord = DB::table('construction_has_equipment')
->where('serial_number', $value)
->where('equipment_id', $equipmentID)
->exists();

if ($existingRecord) {
$fail(__('construction-equipment.construction_equipment_resource.error'));
}
};
}),
->rule(static function (Forms\Get $get, Forms\Components\Component $component): Closure {
return static function (string $attribute, $value, Closure $fail) use ($get, $component) {

$equipmentID = ;

$existingRecord = DB::table('construction_has_equipment')
->where('serial_number', $value)
->where('equipment_id', $equipmentID)
->exists();

if ($existingRecord) {
$fail(__('construction-equipment.construction_equipment_resource.error'));
}
};
}),
11 replies
FFilament
Created by Gush on 11/8/2023 in #❓┊help
Allowing to attach duplicate records
in a belongtomany relationship how do i change the default behavior of not allowing to attach one record twice or more, i already read the docs but its limited and i really dont understand how
20 replies
FFilament
Created by Gush on 10/26/2023 in #❓┊help
DatePicker on edit
On edit i dont want to apply ->MinDate because it would force me to update to date of edit
DatePicker::make('date')
->prefixIcon('heroicon-m-calendar-days')
->required()
->label(__('assistance.assistance_resource.date'))
->minDate(Carbon::now()->addHour()),
DatePicker::make('date')
->prefixIcon('heroicon-m-calendar-days')
->required()
->label(__('assistance.assistance_resource.date'))
->minDate(Carbon::now()->addHour()),
3 replies
FFilament
Created by Gush on 10/24/2023 in #❓┊help
Not allow identic records
How do i not allow user to create records with the same values of existing ones exemple: brand_id->1 model_id->2 i cant pass ->unique() to each field because that would only allow to have one of each
9 replies