morty
morty
FFilament
Created by morty on 4/29/2024 in #❓┊help
Struggling on the simplest thing :( - How do I make a table row clickable to a modal view page?
I have a resource with a modal view page. That works fine. However, I can't seem to figure out how to make the clickable table row open this modal instead of the edit page. Can someone help please?
8 replies
FFilament
Created by morty on 4/16/2024 in #❓┊help
Regression in v3.2.67 - `foreach() argument must be of type array|object, null given`
I really don't want to create a reproduction repo for a GitHub issue. Is anyone else experiencing this when attaching a related record inside a relation manager using a belongsToMany relationship?
5 replies
FFilament
Created by morty on 4/16/2024 in #❓┊help
Can I align header actions with the heading and not the entire heading + subheading?
No description
3 replies
FFilament
Created by morty on 4/10/2024 in #❓┊help
Layout question - Can I put a form beside a table horizontally?
No description
6 replies
FFilament
Created by morty on 4/1/2024 in #❓┊help
Possible bug with exists rule on select multiple form components?
No description
1 replies
FFilament
Created by morty on 3/28/2024 in #❓┊help
Anyone using SPA mode get these console warnings?
No description
1 replies
FFilament
Created by morty on 3/27/2024 in #❓┊help
Is it possible to get the current record when using sub-navigation for the badge?
I'm trying to count the related items for the parent record so I can show a navigation badge when using sub-navigation. Is it possible to get the current record somehow considering this is a static method?
2 replies
FFilament
Created by morty on 3/21/2024 in #❓┊help
How can I refresh the options on a table filter after an action?
I have a select filter on a table called "collection" that filters records if they belong to that collection. I also have a bulk create action to create a new collection and assign the selected records to the collection. My problem is that if I create a new collection, I can't immediately filter the table with that new collection unless I hard refresh the page because the filter options haven't been updated. What do I need to do to have the filter update itself?
17 replies
FFilament
Created by morty on 3/21/2024 in #❓┊help
How do I change the heading on a list page?
No description
5 replies
FFilament
Created by morty on 3/18/2024 in #❓┊help
Infolists inside modals/slideovers need more contrast?
No description
2 replies
FFilament
Created by morty on 3/17/2024 in #❓┊help
ManageRelatedRecords but don't have record title attribute?
What do you guys do when you don't have a title attribute? These should be unique values right? For example, I'm managing "notes" on an account resource. The note table is just an id, note, and timestamps. What should I do here?
2 replies
FFilament
Created by morty on 3/14/2024 in #❓┊help
Is there a way to stop the global search and notification bell from flashing on page load?
No description
5 replies
FFilament
Created by morty on 3/13/2024 in #❓┊help
Can I customize css in `app.css` or am I required to create a custom theme?
Just wondering what the app.css file is even for if not customizations?
8 replies
FFilament
Created by morty on 3/13/2024 in #❓┊help
How can I add `mailto:` to an email in an infolist text entry?
No description
10 replies
FFilament
Created by morty on 3/10/2024 in #❓┊help
How can I remove the view action on a relation page table?
No description
3 replies
FFilament
Created by morty on 3/10/2024 in #❓┊help
Is there a way to group options on a select when using a relationship?
It appears that using both ->options() and ->relationship doesn't really play well together. I'm trying to create group options like seen here: https://filamentphp.com/docs/3.x/forms/fields/select#grouping-options When I do this and try to select an option, I get the following error:
SQLSTATE[42S22]: [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Invalid column name 'collections'.
When I instead use the relationship method, then the options method doesn't seem to work. My code:
Tables\Filters\SelectFilter::make('collections')
->label('Collections')
->multiple()
->options([
'Private collections' => AccountCollection::ownedByCurrentUser()->private()->orderBy('name')->pluck('name', 'id')->all(),
'Public collections' => AccountCollection::public()->orderBy('name')->pluck('name', 'id')->all(),
]),
Tables\Filters\SelectFilter::make('collections')
->label('Collections')
->multiple()
->options([
'Private collections' => AccountCollection::ownedByCurrentUser()->private()->orderBy('name')->pluck('name', 'id')->all(),
'Public collections' => AccountCollection::public()->orderBy('name')->pluck('name', 'id')->all(),
]),
2 replies
FFilament
Created by morty on 3/6/2024 in #❓┊help
Select multiple preloaded options are reordered after selecting the input
I have a select multiple that is formFilled with options already attached on a BelongsToMany relationship. As you can see in the attached gif, the options are visible when the form is shown, but when you click the select input the options are rearranged alphabetically. Is there a way to prevent this or to load the options in already sorted so it doesn't jump on the user? My code:
Tables\Actions\Action::make('manageCollections')
->label('Manage collections')
->icon('heroicon-o-rectangle-stack')
->modalIcon('heroicon-o-rectangle-stack')
->modalWidth(MaxWidth::Small)
->fillForm(fn (Account $account) => $account->collections()->mine()->get()->all())
->form([
Forms\Components\Select::make('collections')
->label('Collections')
->multiple()
->relationship(
'collections',
'name',
fn (Builder $query) => $query->mine())->preload(),
])
->after(
fn () => Notification::make()
->success()
->title('Saved successfully')
->body('Changes to the account have been saved.')
->send()
),
Tables\Actions\Action::make('manageCollections')
->label('Manage collections')
->icon('heroicon-o-rectangle-stack')
->modalIcon('heroicon-o-rectangle-stack')
->modalWidth(MaxWidth::Small)
->fillForm(fn (Account $account) => $account->collections()->mine()->get()->all())
->form([
Forms\Components\Select::make('collections')
->label('Collections')
->multiple()
->relationship(
'collections',
'name',
fn (Builder $query) => $query->mine())->preload(),
])
->after(
fn () => Notification::make()
->success()
->title('Saved successfully')
->body('Changes to the account have been saved.')
->send()
),
I've also tried adding ->orderBy('name') to the formFill query without success. Any ideas?
3 replies
FFilament
Created by morty on 3/6/2024 in #❓┊help
Is there a difference between these two `Auth::user()` vs `Filament::auth()->user()`?
Is there anytime where using one or the other is beneficial?
2 replies
FFilament
Created by morty on 3/5/2024 in #❓┊help
BulkAction too many records, can we chunk these?
I'm running into an issue with a bulk table action. The table has approximately 2500 records but SQL Server has a parameter limit of 2100. Therefore, if I try to run a bulk action on the entire table I get the following error:
SQLSTATE[IMSSP]: Tried to bind parameter number 2101. SQL Server supports a maximum of 2100 parameters.
Is it possible to chunk these before being passed into the action method?
->action(function (array $data, Collection $accounts) {
ray($data, $accounts);
})
->action(function (array $data, Collection $accounts) {
ray($data, $accounts);
})
This is what I mean by the parameter limit:
select *
from [crm].[accounts]
where [crm].[accounts].[id] in (
31LC01, ABEG01, ABGE01, ABOG01, ABWA01, ACEWAN, ADAD01, ADAD02, ADAG01, ADAP01, ADAS01, ADEM001,
ADEM002, ADMI01, ADMM01, ADMM02, ADVM01, AGCA02, AGINN01, AGRC02, AGRE01, AGRILAB, AGRISAC, AGRM01,
AGRM02, AGRO01, AGWO01, AING01, AIRL01, AJ001, etc...
) and ([active] = 1)
order by [name] asc
select *
from [crm].[accounts]
where [crm].[accounts].[id] in (
31LC01, ABEG01, ABGE01, ABOG01, ABWA01, ACEWAN, ADAD01, ADAD02, ADAG01, ADAP01, ADAS01, ADEM001,
ADEM002, ADMI01, ADMM01, ADMM02, ADVM01, AGCA02, AGINN01, AGRC02, AGRE01, AGRILAB, AGRISAC, AGRM01,
AGRM02, AGRO01, AGWO01, AING01, AIRL01, AJ001, etc...
) and ([active] = 1)
order by [name] asc
3 replies
FFilament
Created by morty on 3/5/2024 in #❓┊help
BelongsToMany Select component doesn't populate data in a modal form
No description
5 replies