TiBiBa
Prevent allowDuplicates() when using detach action
Hi! We've implement a MorphToMany relationship that allows for a user -> user_roles -> role relationship. The pivot table looks as follows:
- user_id
- role_id
- team_id
A user is allowed to have the same role multiple times as long as the team is different. By using
allowDuplicates()
attaching new records works as expected. However, when attempting to detach records it crashes, as an id column is expected when allowing duplicates. Is there anyway to get this to work? Thanks in advance!5 replies
Possible to preload Select form input getSearchResultsUsing()?
Hi! I'm struggling with impelementing a custom search form input. Using the
getSearchResultsUsing()
function I've create a custom query based on the $search
attribute. But, I would like to pre-load this query, even when the $search
is still empty. Is it possible to preload this query? Thanks in advance!1 replies
Keep svg viewBox attribute on custom sanitizer doesn't work
Hi! To display icons from a svg column on the resource list page I'm attempting to overwrite the HTML sanitizer to allow rendering SVG. The SVG is whitelisted as expected, but the allowed attributes do not seem to work. I just the following code-snippet for example:
Resulting in the following
dd()
output:
But I did specify on the sanitizer to allow the viewBox
attribute as well. This results in unpredictable sizes. Does anyone have a clue on how to fix this? Thanks in advance!4 replies
Possible to get record from the table row above current row?
For a custom table action I'm attempting to implement an action to copy the values from the
selectColumn
in the table row above the current one into the selectColumn
of the current row. But I can't figure out how to get the current row index and/or the row above. Is this possible? Thanks in advance!4 replies
Crash on list page when switching results per page to 'all'
When on a list page and switching the results per page option to 'all' the pages crashes with a 500 server error. Worst is that I'm unable to visit this page as the filter is saved in the session and keeps returning an error. The following error is thrown:
Anyone have a clue how to solve this? Thanks in advance!
2 replies
Possible to open url in new tab with table form action?
Hi! I'm looking for a way to implement a unique table action. On the Action I want to open a model in which the user can enter some data. On submit I want to open a new tab with a url based on this data. With a normal action this is possible with
->openUrlInNewTab()
. However, I'm unable to find a work-around for a action for which we overwrite the action using a custom modal. The only way I found is using redirect()
but this is not the desired flow. Thanks in advance!2 replies
Possibility to hide sign out option in user menu?
Hi! Our admin panel created with Filament is guarded by an IAP and we don't need the logout functionality. I'm looking for a way to disable the logout option in the user menu bar. Does anyone have a suggestion how to implement this? Thanks in advance!
7 replies
File upload form component not working due to fallback on default guard.
Hi! I'm struggling with implementing the File upload form component. The storage driver is configured to Google Cloud Storage using the Spatie library. This all works fine except for a guard issue. When uploading a file in the form the upload process crashes on a non-existing Authentication provider. Debugging this code results in the finding that the upload process automatically falls back on the default guard (web) whereas we using a custom guard for our Admin panel.
Folllowing the stack-trace it seems to be that the guard name is empty when the following function is called:
src/Illuminate/AuthAuthServiceProvider.php#guard()
. This function automatically takes the default driver when no guard name is provided. Changing the guard name in the config from web
to our custom Admin guard indeed works and the upload process is fine. However, this is undesirable. Does someone have a clue why the guard name can be empty? Thanks in advance!
The custom guard is already set correctly on the PanelProvider using the authGuard()
function.2 replies
Unable to dynamically update own state of RichEditor for component?
Hi! For a form I would like to process the input data of a RichEditor using the
afterStateUpdated()
hook. The data is processed and a HTML table structured string is return, that is supposed to be set as the value of the editor itself. The purpose is to enable pasting data from excel and we render this nicely as preview. The following snippet used to work fine in v2:
However, the form field is not updated when providing some input. I already verified that the last function, parseTableData(), returns data as expected. Weirdly enough, an identical implementation but with a TextInput works just fine! Anyone a clue how this can be fixed? Thanks in advance!2 replies
Notifications works when triggered on mount() but not when triggered on submit()?
Hi! I'm stuck on showing notifications in the panel builder. I'm trying to show a notification to the user to inform them that no results are found for their search query. Using the following approach on a custom page:
The notification is never shown but when I uncomment the
dd()
this is executed as expected. The weird thing is that the notifications seem to work fine on the mount()
function. The following snippets shows a notification when re-loading the page:
Thanks in advance!18 replies
Associate headerAction not showing on Relation manager?
Hi! We've just migrated to v3 and have some issues with a
HasMany
relation and the AssociateAction
. When adding an AssociateAction
to the headerActions of the Relation Manager table the action button is not shown. Using the following snippet the normal action is displayed as expected but the associate action is not. I didn't run into this issue with v2 and unable to find a cause, thanks in advance!
Edit
I run into the same issue with an Edit and Delete action on the items. The View action is rendered as expected. However, Detach actions in turn don't work either. I've tried this accross multiple relation managers.4 replies
Attach / Detach with timestamps and soft deletes?
Hi! For a BelongstoMany relationship with a pivot table we use the RelationManager and the
Attach()
and Detach()
action to add and delete a relation. However, on the pivot table we also have timestamp columns (created_at, updated_at and deleted_at). Is there a way to use soft_deletes and make these follow the Laravel timestamps convention? Thanks in advance!3 replies
Possible to dispatch event in submit() function after variables are updated?
Hi! When updating from v2 to v3 we ran into an error that we are unable to solve. Within a custom page with a form we perform some data mutations in the
submit()
function and store these in a variable $this->tree
. Which, when exists, is automatically updated in the rendered page. Lastly in the function we threw an emit()
to trigger a JS function in the front-end and load an external library. This al worked fine but with the switch to v3 (and Livewire v3) emit()
is replaced by dispatch()
.
For some reason the ordering of events is now changed. The dispatch()
is thrown before the variable is updated on the front-end, making the JS library crash as no value is found. The same use-case worked fine in v2. Is there a way to force a re-render within the submit()
function before I manually dispatch an event? Alternatively would be to dispatch the custom event after the updating in some way. Thanks in advance!5 replies
Alternative for emit() in v3?
Hi! When updating from v2 to v3 a custom page broke due to an
emit does not exist.
error. The page implements HasForms
and worked fine in v2. The event was caught in the blade template like this:
Do anyone have a suggestion how to handle the same functionaliy in v3? Thanks in advance!6 replies
Dynamically disabling form field doesn't work?
Hi I'm look to dynamically disable a form field based on if the field is filled. Using the following snippet I expect the form field to be disabled after, but it doesn't do anything:
Am I doing something wrong?
Edit
The snippet does work on a "normal"
TextInput
but not on a MarkdownEditor
. However, the same disabled()
property should work.4 replies
Dynamically switch MarkdownEditor to preview mode?
Hi! I'm currently working on a custom page were the users can paste some data (for example for excel), which we validate and parse directly with the
wire:paste
action. Afterwards I would like to dynamically change the mode for the editor from Edit to Preview. Is this possible? Thanks in advance!4 replies
Crash on getTableFilterState() on select filter with relationship
Hi! We are looking to prevent initial loading of the first x resources when opening a list resource page and came up with a solution like this:
Whereas the
countActiveFilters()
is as follows. This works fine when using a text input filter or a select filter with manual options. But when using a select filter based on a relationship the page crashes. Is there any way to improve this code? Thanks in advance!
14 replies
Add condition to recordSelectOptionsQuery() based on current resource
Hi! When in the relation manager I'm trying to attach a new relation. I would like to modify the query options to only allow a specific subset of options. I would like to adjust the
recordSelectOptionsQuery()
condition based on an attribute of the resource for which I'm adding a relation. Is this possible? Thanks in advance!1 replies