vkDas
Saving null while disabling a select field
Hello there, I am using a select field. When the admin is logged in, admin can choose a user. However, for a regular user login, they cannot choose a user. Instead, I am passing the logged-in username with the 'disabled' attribute. But when I am saving the record, it is becoming null. Please help me to fix this issue.
code
Select::make('user_name')
->options($users)
->disabled($userIsUser)
->default($userIsUser ? $loggedInUserName : '')
->searchable()
->required(!$userIsUser),
5 replies
Table data loading slow
I have multiple resources, and two of them contain split() and stack() layouts. The rest of the resources load list table data properly, but the two resources with split() and stack() layouts exhibit slow loading, even though I display only 20 data per page. Additionally, the loading skeleton for these two layouts is not appearing. How can I optimize the performance of these tables?
7 replies
Livewire\Exceptions\ComponentNotFoundException issue
I am facing an error i.e. Unable to find component: [app.filament.resources.appraisal-response-resource.pages.appraisal-response-request] . This error is occurring when the page is loading for the first time, when refreshing the page, when i try to update any field and when I click on the save button. Please help me to solve this issue. Thank you.
15 replies
Default data not showing in page
I have a custom resource page in which I have sent an email through this resource and a page will open when I click on the button present inside the mail and I want to show the corresponding data and the data is present inside the mount function but the data is not showing in the UI . All the data is present inside the $appraisal_response. Please help me to fix this issue...Thank you and here is the code
class ResponseRequest extends EditRecord
{
protected static string $resource = ResponseResource::class;
protected static string $layout = 'components.response-request.layouts.app';
public $employee_code_with_full_name;
public $review_period_start_date;
public $review_period_end_date;
public $type;
public $appraisal_session_id;
public function mount(int | string $record = null): void
{
try {
$data = JWT::decode(app('request')->input('token'), ['header' => true]);
} catch (\Throwable $th) {
abort(403);
}
$appraisal_response = Response::where([['id', $data['response_id']], ['status', ResponseStatus::DRAFT]])->first();
// dd($appraisal_response);
if (!$appraisal_response) {
abort(404);
}
parent::mount($appraisal_response->id);
}
protected function getHeaderActions(): array
{
return [
//
];
}
protected function afterSave(): void
{
$this->record->status = ResponseStatus::SUBMITTED();
$this->record->save();
}
public function form(Form $form): Form
{
$form = static::$resource::form($form, true);
return $form;
}
}
5 replies
How to use hex color code in v3 after upgrade from v2 to v3
I have used tailwind css colors like bg-primary-500 in v2 and after upgrade to v3 I want to use hex color code like #fffff but when i am taking any hex code from documentation and giving a custom name like 'test' => Color::hex(#ff0000) it is not showing the output in UI but if I give 'primary' => Color::hex(#ff0000) it is showing in UI. How can I fix this? Thank you
4 replies