Albert Lens
Default repeater items not working
Hello.
I have an action button on a table to send an email. It opens a form to write the subject and type receivers. I need to fill in two different receivers by default, but it is not working.
Please, any ideas of how to achieve this?
I have tried with Repeater:: and also with TableRepeater::
Tks.
4 replies
Redirect::route with long parameters works locally but not on server
Hello.
I have been trying to find a solution for exporting a PDF with the information on the table seen but with the filtered data. To do so, I do a return Redirect::route passing thedata and arrays, which is quite long, but works fine locally. My code is this:
I have been working a lot to achieve this and now it works fine locally but when I have deployed to the server it throws an uncontrolled error "THIS WEBSITE CANNOT BE ACCESSED".
The result of the redirect is very long, as you can see in the attached image. Any ideas of how can I solve this or get around to the way I send the FILTERED info to the controller?
This is my controller, which gets the filtered array:
Maybe my approach is incorrect but it is working locally for me. Any ideas will be highly appreciated.
Thank you.
2 replies
How can I get the sorting applied in table to use it in view
Hello. I am exporting only the data that user has filtered, using:
And it works fine for me becuase the view only includes filtered data.
But now I would also like that view to SORT the data exactly the same as the user has sorted in the table.
Any ideas of how I can get that sorting information, please?
Thank you.
4 replies
$record->relationship->fieldData not working
I have a resource for persona (People in Spanish) and I am showing a column which comes from a relationship and it is working correctly.
Now I need to make an action which will redirect to a different URL depending on the value in that columns TipoExp.
I have tried this:
But it is returning nothing. It looks as if $record->tipoExp has nothing inside.
I have also tried to access through the related relationship, but it is not working either:
Not working either.
How could I solve this, please??
2 replies
->RenderHook() problem in AdminPanelProvider.php | Class "Filament\View\PanelsRenderHook" not found
Hello.
I had this same configuration in my last application two months ago and had no problems.
For this new application I am beginning now, I wanted to have the same exact renderHook and used the same in AdminPanelProvider.php
It looks to me as if something is still pending to be installed, because in my previous application where it is working I can right click over the word PanelsRenderHook and click on "Go to definition" and it opens:
vendor\filament\filament\src\View\PanelsRenderHook.php
But with his new one it says it cannot find the definition file "Definition not found".
Any ideas of what I am missing.
Thank you
10 replies
Mail problem rendering view with data with two arrays
Hello. I have a row action which lets users send email with attached Pdf with some info about the record. Everything works fine.
Now I want the user can change subject and body of the email and I have included a form and user can type.
And it works fine till then. I launch the mail with the data:
The view can manage $expediente->whateverfield correctly but $data is undefined.
Any ideas, please?
3 replies
How can I automatically launch a function when user enters a Resource list page?
I need to update some data before users access the mediaResource list page (table).
What would be a correct approach to automatically launch the function I need as soon as user enters that url (https://apps.geslem.com/media) ?
For the moment, I have put a button that users have to click to run the funcion:
Any ideas, please?
Tks in advance.
3 replies
RenderHook css problem in login page (dark / light theme)
Hello.
I am using a PanelsRenderHook::TOPBAR_START to render a copyright view in my application and it is working fine using CSS for dark or light mode.
Working fine with this CSS to know whether it is dark or light mode:
My CSS:
The problem is that for the login page I am using:
and the same CSS which works inside the application is NOT WORKING FINE in the login page. It is able to know when theme is dark, but it shows both logos (dark mode and light mode ones) when theme is light.
Any ideas, please?
4 replies
Tailwind help please
Now that my application is developed at 90% it is time to customize styling details. I have begun customizing my own Tailwind classes but NOTHING HAPPENS. Very probably I am doing something wrong.
I have followed the OD (Official Docs) here: https://filamentphp.com/docs/3.x/notifications/installation#installing-tailwind-css
For example, I have a resource table where I want to customize the row according to one $record->value, like this:
And in my resources\css\app.css file I have put my new class:
And I run npm run build
What am I missing or doing wrong, please???
6 replies
How to validate repeater items certain conditions before create - Attributes IN repeater items
Hello.
Not possible with observer or with mutateFormDataBeforeCreate
I have a form to create dossiers, and each dossier can have multiple interveners; I am using a repeater. I need to validate, for example, if there are 3 interveners and not all 3 have the field invoiceable == true then halt and prevent the user from saving the Dossier and make Notification.
The fact is that if I use mutateFormDataBeforeCreate(array $data): array and I dd(data); I see no interveners array (no array for the repeater) and I cannot check.
Also, using an Observer, in the creating function, attributes DO NOT include repeaters, so this always gives an empty array for the interveners repeater (hasMany RelationShip):
Any ideas of how I can validate repeaters counts and fields attributes inside the repeaters???
Thanks.
4 replies
Missing New panel resources - links don't appear on sidebar - 404-Not found
Hello.
I have been developing an app since the beginning of February and everthing was Ok. I have been creating 11 new resources and everytime their appeared on the sidebar menu.
Today I have created two new resources and no links appear. If I manually type the url => http://127.0.0.1:8000/facturas it works perfectly. Even the links to http://127.0.0.1:8000/facturas/create and http://127.0.0.1:8000/facturas/1/edit
But I cannot see the links to the two new resources.
I have run:
But those two new links don't appear.
I have no Policies created yet.
Any ideas of what can be happening. I'm really puzzled.
17 replies
How to reuse functions using services
Hello.
I have made a function that I need to call from two different observers, and both in the created and update methods (I have to call it 4 times).
I have tried to have one only function in an functions file and call it from the 4 different places, but I have not succeded. It is just a 10 line function, but there must be a better way to do this either than repeating the code 4 times.
Any ideas of how to call a function which is in an external FUNCTIONS CUSTOM FILE from inside the observers?
I understand that inside the same Observer I can use:
$this->nameOfFunction()
But how to call that from an outer file?
4 replies
New custom login page not working according to documentation. Please help
Sure I am forgetting something obvious but cannot see what.
I want to create a completely new login page form, so I have done this:
1.- Create a new page and blade view with ==> php artisan make:filament-page Auth/Login
2. - Changed the Login class like this:
3. - In AdminPanelProvider changed the ->login() for this => ->login(Login::class) and imported the class with:
But I can see no changes at all. I have added some text for testing in my view located at: resources\views\filament\pages\auth\login.blade.php
Any ideas of what I am doing wrong??
I am using Filament v3.2.41
Thank you very much.
13 replies
getFormActions / getCreateFormAction - Need to customize the save button to add more functionality
I have a resource in which I need to change the SAVE button by a new one which saves and also adds some function that I have prepared.
How can I achieve this, please?
I have tried adding this function to the CreateResource.php:
But I do not know how to:
- Add my special function to that button (I want it to add the record to the table and do other things as well)
Any ideas, please?
I have also tried using an observer, which works fine, but then the problem is knowing how to:
- change or delete the notification typical message of "created", because my other function also gives a message and one is shown covering the other.
Tks.
4 replies
Opening URLs from notification actions thows error ==> Route [pagos.index] not defined.
Hello. I have an action in a notification which I want to take the user to a resource index page. The resource is called pagos. I have used the official documentation in:
https://filamentphp.com/docs/3.x/notifications/sending-notifications#opening-urls-from-notification-actions
and only changed route('posts.show') for route('pagos.index')
And it thows the same error. I have tried with 'admin.pagos.index', 'pagos', 'admin.pagos', tried in singular pago but I cannot achieve it.
Any ideas, please:
My code:
15 replies
function in getOptionLabelFromRecordUsing() not working - Relationship of a Relationship
I need help, please.
This is my Select:
It is showing the values for the field in the pluck('interviniente_id') but it is not showing the $persona->nombreCompleto.
In the dropdown I see ids corresponding with "Persona" model ids (which is OK), so I only need to get those ids it is showing and replace them by the names or names and surnames of the persona model.
No matter what I put in the getOptionLabelFromRecordUsing function, it always shows the same.
I have also tried with getOptionLabelsUsing and nothing works.
My relationships are MODEL_01 belongsTo MODEL_02 which also belongsTo MODEL_03, so how can I put the name of the field I need to retrieve?
MODEL_01->MODEL_02->MODEL_03->fieldName or MODEL_01.MODEL_02.MODEL_03.fieldName ???
Nothing is working for me in that Select.
Any help will be highly appreciated. Many thanks.
2 replies
Mutate Data before Create (calculated column)
Hello.
I need to calculate a column with series & id.
The fields are Id, Series, NumExp and I need numExp to be equal to SERIES-ID
If series is ABC and id is 20, I need numExp to be ABC20
I have tried this mutateFormDataBeforeCreate but it is not working.
Is there a boot method in the Model or something, please?
Tks.
9 replies
Need Notifications to be centered and bigger. Getting error doing what docs say.
Hello.
I need to change the look and position of the notifications saying:
Created.
Deleted.
Saved correctly.
I have followed the official docs here : https://filamentphp.com/docs/2.x/notifications/customizing-notifications
I have put this code in app\Providers\AppServiceProvider.php
I have also created the blade view file at resources\views\notifications\notification.blade.php
But I am getting an error:
Unable to locate a class or view for component [notifications::notification].
It takes quite a few seconds thinking before thowing that error.
Any ideas of what might be happening or what I am doing wrong.
This is the first time I need to customize the notifications duration, size, etc.
Tks.
2 replies