GDG
3.2.79 appears to have broken Select that aren't multiple (Not sure if this is specific to Shield)
In 3.2.78 this worked fine
Forms\Components\Select::make('roles')->label('User Role')->relationship('roles', 'name')->preload()->searchable(),
but in 3.2.79, when attempting to save my user with a role, I receive the following error array_diff(): Argument #2 must be of type array, string given
If I change my Select to have ->multiple()
then it works again but obviously then has the side effect of letting multiple be selected.
Playing around with this a bit, if I save my user with the Select containing ->multiple()
with 1 entry and then remove ->multiple()
go into my user and change the role then it saves just fine but if I remove all role associations to my user, save, then try to add a role back and save, then the error appears again.
I can see there was some changes to Select and CheckboxList in 3.2.79 so it is either something broke it there OR I need to be doing something different here now to accommodate for the changes made.
Can keep as a multiple for now as I develop the rest but I would be keen to understand if I am doing something wrong here 🙂7 replies
Uploading font files .ttf and .otf
Has anybody been able to upload .ttf or .otf font files using FileUpload?
I have even tried the following
->acceptedFileTypes(['application/x-font-ttf', 'font/ttf', '.ttf'])
but I constantly get "File of Invalid Type".
Not doing anything crazy with the component and images etc work just fine.
Forms\Components\FileUpload::make('header_font_file')->directory('fonts')->visibility('public')->acceptedFileTypes(['application/x-font-ttf', 'font/ttf', '.ttf'])
38 replies
How would we implement MFA on Filament admin panel using a confirmation code sent over email
Hey everyone,
One of my guys is trying to intercept the login flow on the panel with some middleware that will only allow login if the user enters a confirmation code that would get generated and sent over email at the point of attempting to log in.
Could somebody point me in the right direction of what steps would be required to complete this in 3.0 please?
He has tried tapping into the process before session start but this has proven to be cumbersome so I just wanted to see if there is an easy way to do this and we are maybe overthinking things as can often be the case when deadlines loom etc
We may have to resort to using the 2FA plugin to get this moving BUT I can't help but feel like we are missing some simple steps that may make this possible.
Any help would be greatly appreciated and welcome, thank you.
12 replies
When using hasCombinedRelationManagerTabsWithContent(), how can I change the title of the first tab?
I am using
hasCombinedRelationManagerTabsWithContent()
to organise RelationalManagers into a top tab within my resource but when I do this on the edit page, the first tab is always titled "Edit".
Is there a way to rename this? Thanks in advance for any help.3 replies
Is it possible to make a table column unique on a per tenant basis?
I have implemented multi-tenancy into my application but I want to restrict the name attribute of my Project class to be unique BUT on a tenant by tenant basis.
For example: I have
$table->string('name')->unique();
which only allows a single, unique name but what I want to do is if Tenant A names it Project1
and then tries to create another called Project1
then that will not be allowed but if Tenant B called one Project1
then this would be fine.
Is this possible using any helper or is this going to be a custom function I will need to build? Thanks for your help in advance.10 replies