Finn
Required but only on create?
Is there a way to set a field to only be required on a create action? For example when editing a user - on create they require a password to be entered but on update they do not always need to update their password.
9 replies
Filtering a Select field's options based on a parent relationship
I'm creating a form where I can create a new instance of a
CompletedTrainingQualification
, which uses a BelongsTo TrainingQualification
relationship, which in turn BelongsTo a TrainingProvider
.
My issue is that I would like to have a form that utilises a select box to select a provider, and then the value of training_qualification_id can be selected in a seperate select box (using the normal select relationship field in filament), where the options are only those which have a training_provider_id of the one selected.
I am open to achieving this is a different way too, but the main point is being able to select a qualification based off of the provider, where the provider is not stored on the CompletedTrainingQualification record when the form is submitted.
Grateful for any help, cheers.4 replies
Use a custom widget to run a command from the dashboard
Hi all, I'm looking to have the ability to run a command to generate a report for data on the dashboard, however there doesn't seem to be much documentation about how to use custom widgets unless I'm missing something?
The desired functionality is for a user to click on a widget (or a button in the widget) on the dashboard which will run a script (probably a laravel console command) to generate a report and then download the report to the user's machine.
Does anyone know how I might go about doing this? Specifically I'm asking for help RE: the widget / dashboard side of things.
Thanks
11 replies
Can Relation Managers be eager loaded without having to scroll down?
I have a single relation group attached to a resource, which contains 7 relation managers so that the relationships are shown sequentially on the same page. This functionality works great, however there is a slight UX hiccup where the relational managers are only loaded once I scroll down the page, and it then takes a couple of seconds for them to load in. I was wondering if anyone could give me some advice on how to deal with this issue, or if it's possible to eager load the relationships when they're being used in this way.
1 replies
Selecting only a year
Does Filament's datepicker offer an option for only years being able to be selected?
Is this something that's better to do that with a different input type? My database column is a datatype of year(4).
My current solution is:
6 replies
Setting a default value for hidden fields
I have model which stores the user_id of the person who created each record. I don't want the user to see this field when interacting with the form - it should all happen behind the scenes.
The issue is that when I use:
I get an SQL error
SQLSTATE[HY000]: General error: 1364 Field 'user_id' doesn't have a default value
.
Anyone know a solution for this?8 replies
Enable relational manager table actions based on a policy
I have a policy for my notes table (which is only accessible through a different resource's relational manager) where I want to allow a record to be updated or deleted only by users that have authorization via said policy. Does anyone know how I can go about doing this?
NotePolicy.php
NotesRelationalManager.php (current, non-working attempt)
5 replies