Prosp30
Prosp30
FFilament
Created by Prosp30 on 1/28/2024 in #❓┊help
Reset password email locale
Yes publish translation files. In my case it was croatian
6 replies
FFilament
Created by Prosp30 on 3/19/2024 in #❓┊help
Download PDF using Spatie Laravel-PDF on table action
Let me know if it works for you
23 replies
FFilament
Created by Prosp30 on 3/19/2024 in #❓┊help
Download PDF using Spatie Laravel-PDF on table action
yeah, but it works 😄
23 replies
FFilament
Created by Prosp30 on 3/19/2024 in #❓┊help
Download PDF using Spatie Laravel-PDF on table action
@toeknee
23 replies
FFilament
Created by Prosp30 on 3/19/2024 in #❓┊help
Download PDF using Spatie Laravel-PDF on table action
I managed to do it return response()->streamDownload(function () use ($record) { echo base64_decode(Pdf::view('pdf.invoice', ['invoice' => $record]) ->format('a4') ->footerView('pdf.invoicefooter') ->name('your-invoice.pdf') ->base64()); }, 'test' . '.pdf');
23 replies
FFilament
Created by Prosp30 on 3/19/2024 in #❓┊help
Download PDF using Spatie Laravel-PDF on table action
I'll try it today, I have an idea but I doubt it'll work
23 replies
FFilament
Created by Prosp30 on 3/19/2024 in #❓┊help
Download PDF using Spatie Laravel-PDF on table action
That is my backup idea, I am trying to avoid it if it's possible
23 replies
FFilament
Created by Prosp30 on 3/19/2024 in #❓┊help
Download PDF using Spatie Laravel-PDF on table action
I am trying to do it this way, but no luck. Any ideas? return response()->streamDownload(function () use ($record) { Pdf::html('<p>test</p>') ->format('a4') ->name('your-invoice.pdf'); }, 'test' . '.pdf');
23 replies
FFilament
Created by lodeki on 2/26/2024 in #❓┊help
Very slow app
Also, be careful when using relations... Ie $this->products and $this->products() are not the same... One fetches the relation, other one makes an SQL query that fetches ALL the records in that relation, and then uses your where clauses...
10 replies
FFilament
Created by gigiloouu on 2/26/2024 in #❓┊help
textInput live error
I did the following Lets say in db field name is unit_price I make a hidden field named unit_price. Thats the one that gets updated. Then I use a presentational field named unitPrice, thats the one where user inputs some numbers. Once the user is done, the field gets formatted the way I want it (currency) and before the formatting, I set the numeric value of unit_price. Also I check in afterStateUpdate on unitPrice if the field is empty, less than 0 etc and set both fields to 0. Not the greatest solutiom but it works. For edit page, just use mutateFormBeforeFill and set unitPrice value from unit_price Also, I use fkoatval on mutateFormDataBeforeSave on unit_price just to be sure its the right type 😁
34 replies
FFilament
Created by humunuk on 2/24/2024 in #❓┊help
InfoList TextEntry alignEnd() only applies to text but not Label
Try using inlineLabel() Had the same issue, haven't found a way to get it on the right. Or try using a PlaceHolder before that one with value of your label, and keep the labels empty
4 replies
FFilament
Created by Prosp30 on 2/23/2024 in #❓┊help
Money formatting a live field
Thanks, saved my day. Totally forgot about that
5 replies
FFilament
Created by shashika on 2/16/2024 in #❓┊help
How to override filament default form data store method
Share some code
14 replies
FFilament
Created by gigiloouu on 2/19/2024 in #❓┊help
datepicker
5 replies
FFilament
Created by H4L1M on 2/17/2024 in #❓┊help
Form Component Placeholder
Yes you can inject html code inside of content() and just use inline css
5 replies
FFilament
Created by Prosp30 on 2/18/2024 in #❓┊help
Custom text format
Non editable, auto filled. I looked into it, since theres only a set of amount of fields, I just use regex to check if the format is okay and then use string replace on a model function, when the value needs to be calculated and returned to the TextInput field. Works great. I was kinda hoping something like that exists in Filament, since it keeps blowing me away with how some things are simple ti make 😁
4 replies
FFilament
Created by DianaMujoiu on 2/16/2024 in #❓┊help
Tenancy or alternative?
Also you could use tenancy and limit users to be able to have only one tenant (team), but if you wont have multiple users in one team, it kinda defeats the purpose
7 replies
FFilament
Created by DianaMujoiu on 2/16/2024 in #❓┊help
Tenancy or alternative?
You could use login listener. Have each new user a certain status. On login, if user has that status, redirect the user to a custom page where there's a form. Alternatively, you could overwrite register part of the app, and instead of a single form use a form wizard where user needs to input all the details. Then handle the registration and write everything where it needs to go
7 replies
FFilament
Created by Prosp30 on 2/10/2024 in #❓┊help
Update pivot table when editing record
I managed to save it and make it editable by using User CreatePage protected function handleRecordCreation(array $data): Model ... $tenant->users()->attach($user->id, ['operator_id' => $data['teamUser_operator_id']]); EditUser protected function handleRecordUpdate(Model $record, array $data): Model { $record->update($data); $record->getCurrentTeamUser()->update(['operator_id' => $data['teamUser_operator_id']]); return $record; } Got it to display the data correctly on the table, but still having issues on making it sortable... Any help would be appreciated 🙂 TextColumn::make("teamUser.operator_id")->label('Oznaka operatera') ->getStateUsing(fn ($record) => $record->getUserInTeam()->first()->pivot->operator_id),
3 replies
FFilament
Created by Prosp30 on 2/10/2024 in #❓┊help
RelationManager form actions
Figured it out. On Relation resource page, under the create actions I can just use ->modalFooterActionsAlignment(Alignment::End)
3 replies