Roshan_k
Debounce issue
<input type="text" required
wire:model.lazy="materialList.{{ $index }}.material_code"
wire:input.debounce.500ms="searchMaterialCodes({{ $index }}, $event.target.value)"
class="w-full mt-1 border-gray-300 rounded-md shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"
placeholder="Enter Item code"
x-ref="materialInput_{{ $index }}"
@keydown.arrow-down.prevent="onArrowDown()"
@keydown.arrow-up.prevent="onArrowUp()"
@keydown.enter.prevent="selectCurrent()"
wire:ignore
>
here if i given wire:input.debounce.500ms="searchMaterialCodes({{ $index }}, $event.target.value)" the entered text are deleting how to solve it...2 replies
Sub Navigation
public static function getPages(): array
{
return [
'index' => Pages\ListStudents::route('/'),
'create' => Pages\CreateStudent::route('/create'),
'edit' => Pages\EditStudent::route('/{record}/edit'),
'view' => Pages\ViewStudent::route('/{record}'),
'communications' => Pages\ManageStudentCommunications::route('/{record}/communications'),
'informed-leaves' => Pages\ManageStudentInformedLeaves::route('/{record}/informed-leaves')
];
}
, here communications & informed-leaves getting inside edit but i need separate menu for edit and communications & informed-leaves in one sub navigation. can we achieve this?2 replies
Action
Tables\Actions\Action::make('products')
->action(function () {
})
->form([
Hidden::make('data')
->default(function ($record) {
return $record->id;
}),
ViewField::make('test')
->view('filament.pages.event-visitor-products'),
])
->modalHeading('Products')
->modalActions([]),
here i need to hide modalActions, in v3 how to hide?4 replies
Custom Pages
public static function getPages(): array
{
return [
'index' => Pages\ListEvents::route('/'),
'create' => Pages\CreateEvent::route('/create'),
'edit' => Pages\EditEvent::route('/{record}/edit'),
'register' => Pages\Registration::route('/2/register'),
];
}
here 'register' => Pages\Registration::route('/2/register'),
instead of 2 i need to pass record how to pass it..3 replies
filters
Iam using SelectFilter in resource, while selecting item in a filter the table data not filtering, only when i reload the page that time only filtering, why like this? and my code will be like
->filters([
SelectFilter::make('day_id')
->label('Day')
->options(fn () => WeekDay::whereNot('id', config('constants.weekend_day.sunday'))->get()->pluck('name', 'id')->toArray())
->query(function (Builder $query, array $data) {
if (!empty($data['value'])) {
$query->where('day_id', $data['value']);
}
}),
])
6 replies
FileUpload
After Uploading a image using Fileupload the preview of image not loading , iam getting an error..This is my code
FileUpload::make('details.image')->preserveFilenames()->enableOpen()
->getUploadedFileNameForStorageUsing(function (TemporaryUploadedFile $file): string {
$timestamp = Carbon::now()->timestamp;
return (string) str($file->getClientOriginalName())->prepend($timestamp.'_');
})
->image()->directory('incident-images')->enableDownload()->label('Image Upload'),
this is .env APP_URL=http://localhost
, this is my filesystem 'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
],
, please anyone help me to solve this error4 replies
Custom page
After creating data using reource need to redirect to a custom page with created record id, how to get that id through route..
in getgaes of resource i added like this
public static function getPages(): array
{
return [
'details' => Pages\VehicleDetails::route('/details'),
];
}
,
in createpage i added
protected function getRedirectUrl(): string
{
return $this->getResource()::getUrl('details');
}
4 replies