Hemanath
Unable to resolve repeater text input problem
i am using repeater. When i define some base price inside text input its not taking after typed 500; its show only 5 automatically removing inside the textbox 00 values how to resolve any solution in filament or anyone advise me to resolve the issue...
6 replies
'SelectColumn ' i am using in my project
SelectColumn::make('status')
->options([
'draft' => 'Draft',
'reviewing' => 'Reviewing',
'published' => 'Published',
]) This is my code i am saved inside the table field like status ,but i need to save one more place inside Json field so how to update the field using select column can anyone explain or how to achieve this?
3 replies
pxlrbt/filament-excel ExportAction
protected function getTableHeaderActions(): array
{
return [
ExportAction::make()
->label('Export')
->exports([
ExcelExport::make()
->withFilename('Materials sales report')
->withColumns([
])->fromTable(),
]),
];
} this is my code i need to give default(0) for withcolumns any possibilities to give ..?
Please suggest me any other way.
1 replies
Filament Access
What I am trying to do: I want give filament access to the particular user role.
What I did: I used public function canAccessFilament(): bool inside the user model.
My issue/the error:
Cannot redeclare App\Models\User::canAccessFilament()
Code:
public function canAccessFilament(): bool
{
return $this->role != 'member';
}
11 replies
How use ->action() and ->url
I trying use the form and send the form data through the ->url(), if i use ->url() without opening the form it is redirecting to the url.
Action::make('Print Label')
->action(function ($record, array $data) {
//
})
->url(
fn (Despatch $record, array $data): string => route('web.despatchprintlable', ['record' => $record, 'space' => Arr::get($data, 'space_no')]),
shouldOpenInNewTab: true
)
->icon('heroicon-s-download')
->visible(function ($record) {
$transactions = Transaction::find($record->transaction_ids);
$flag = false;
foreach ($transactions as $k => $transaction) {
if ($transaction->sub_master_id == config('constants.transaction_types.cm_request')) {
$flag = true;
break;
}
}
return ($flag) ? true : false;
})
->form([
TextInput::make('space_no')->numeric()->minValue(0)->required(),
])
->modalWidth('xl')
->modalbutton('Print Lable'), this is the code.
6 replies
Forms\Components\Repeater::make('addresses')->relationship('addresses')
i am using the relationship in the repeater , but i am not getting that repeater data inside the handleRecordCreation(array $data) $data variable. How to get that data without removing the ->relationship.
4 replies
I am saving data inside the array,i need to search in list table
TextColumn::make('details.class_name')->toggleable()
->searchable(), I am saving data inside the array,i need to search in list table. i could not achieve the data to search. Please guide me how to resolve.
1 replies
Livewire function has used but show some errors
'<input type="number" wire:change="updateCount({{$l}})"
public function updateCount($l)
{
dd('Hello', $l);
} it showiing error like nable to resolve dependency [Parameter #0 [ <required> $l ]]'
3 replies
Export Action::make()
'ExportAction::make()
->label('Export')
->exports([
ExcelExport::make()
->withFilename('Employees')
->withColumns([
[])->fromTable()->modifyQueryUsing(fn ($query) => $query->where('status', 'Active'))
,
[]) i am using export action, How do I change the heading font to bold? Can any one kindly advise how to change ...'
9 replies
Repeater iteration
Forms\Components\Select::make('material_id')
->label(function (Closure $get, callable $set) {
return 'Item';
})->reactive()
->options(function (Closure $get, callable $set) {
$misc = FranchiseeMiscItemPrice::where('material_group_id', 42)->pluck('material_id');
$material = Material::whereIn('id', $misc)->pluck('name', 'id');
$selectedMaterialIds = collect($get('details.items'))->pluck('material_id')->filter();
$material = $material->except($selectedMaterialIds);
return $material;
})->columnSpan([
'lg' => 2,
])->searchable()->required(),
I am using this field inside the repeater. I am trying to achieve that I don't want to show the same data that I was selecting before in the repeater.6 replies
How to redirect from one record to another record with the passing the value()
->actions([
Tables\Actions\EditAction::make(),
Action::make('employee_details')->label('Employee Details')
->url(fn (Work $record) => EmployeeWorkResource::getUrl('index', ['record' => $record])),
]) kindly advise me to how to redirect
15 replies