Albert Lens
Albert Lens
FFilament
Created by Albert Lens on 10/3/2024 in #❓┊help
Default repeater items not working
It works, though it fills only emails but leaves blank subject and contents (which had a default value) Anyway, I have put all default values in fillForm like this:
->fillForm(fn ($record)=>[
'emails' => [
['email' => '[email protected]',],
['email' => '[email protected]',],
],
'subject' => 'Production Order ' . $record->id,
'contents' => 'We are hereby attaching our Production Order ' . $record->id . ' for immediate production.'
])
->fillForm(fn ($record)=>[
'emails' => [
['email' => '[email protected]',],
['email' => '[email protected]',],
],
'subject' => 'Production Order ' . $record->id,
'contents' => 'We are hereby attaching our Production Order ' . $record->id . ' for immediate production.'
])
Thank you very much for your help, mate.
4 replies
FFilament
Created by raheel3031 on 9/13/2024 in #❓┊help
slug is not generated within createOptionForm
Try using: ->live(onBlur: true) also on the field to be set, that is, slug. I usually do it that way.
7 replies
FFilament
Created by Albert Lens on 9/12/2024 in #❓┊help
Redirect::route with long parameters works locally but not on server
I have considerably reduced the size of the url and now it works, though I think this is not the right approach.
public function exportToPdf($modelType)
{
$query = $this->getFilteredTableQuery();
$this->applySortingToTableQuery($query);
$SortColumn = $this->getTableSortColumn() ?? 'id';
$SortDirection = $this->getTableSortDirection() ?? 'desc';
$stocks = $query->pluck('id')->toArray(); //NOW I ONLY GET COLUMN ID and not all columns
// $stocks = $stocks->toArray();
return Redirect::route('pdf.export', ['stocks' => $stocks, 'model' => $modelType, 'sortColumn' => $SortColumn, 'sortDirection' => $SortDirection]);
}
public function exportToPdf($modelType)
{
$query = $this->getFilteredTableQuery();
$this->applySortingToTableQuery($query);
$SortColumn = $this->getTableSortColumn() ?? 'id';
$SortDirection = $this->getTableSortDirection() ?? 'desc';
$stocks = $query->pluck('id')->toArray(); //NOW I ONLY GET COLUMN ID and not all columns
// $stocks = $stocks->toArray();
return Redirect::route('pdf.export', ['stocks' => $stocks, 'model' => $modelType, 'sortColumn' => $SortColumn, 'sortDirection' => $SortDirection]);
}
Anyhow, I still think this is not the right approach because when user has thousands of records filtered, I do not know whether the url size will work on production server. Please any ideas of the right approach to pass FILTERED table data to CONTROLLER ? Tks.
2 replies
FFilament
Created by Albert Lens on 9/10/2024 in #❓┊help
How can I get the sorting applied in table to use it in view
Great! It works fine. Thank you very much.
4 replies
FFilament
Created by Albert Lens on 5/28/2024 in #❓┊help
->RenderHook() problem in AdminPanelProvider.php | Class "Filament\View\PanelsRenderHook" not found
Tks but of course I have imported the class:
use Filament\View\PanelsRenderHook;
use Filament\View\PanelsRenderHook;
And it is still not working as I mentioned. The most relevant for me, I think, is the fact that this file is missing: vendor\filament\filament\src\View\PanelsRenderHook.php which in my previous application two months ago was there and everything worked fine. I could manually copy that file from my previous project for another client but I think this is not a good solution. Thank you
10 replies
FFilament
Created by Albert Lens on 3/23/2024 in #❓┊help
Mail problem rendering view with data with two arrays
I solved it!!! Looking at the official info from Laravel: https://laravel.com/docs/11.x/mail#configuring-the-view I don't have to pass the data in the ->content(...) It has to be added to the content function itself:
public function content(): Content
{
return new Content(
view: 'expedientes.email',
with: ['data' => $this->data],
);
}
public function content(): Content
{
return new Content(
view: 'expedientes.email',
with: ['data' => $this->data],
);
}
The with: is the solution to add extra data apart from the Expediente resource data.
3 replies
FFilament
Created by Albert Lens on 3/22/2024 in #❓┊help
Row action confirmation message is blank
Thank you. When using ->hiddenLabel('some text label') it shows the message, but not the some text label in hiddenLabel. It shows the text inside the make.
Action::make('This text will be shown in the confirmation message')
->hiddenLabel('this label will not be shown in the message or the row')
->tooltip('Enviar carpeta por email')
->action( function (Expediente $record) {
$receivers = ['email' => Auth()->user()->email];
$expediente = Expediente::find($record->id);
Mail::to($receivers)->send(new ExpedienteCarpetaEmail ($expediente));
})->requiresConfirmation()
->icon('mail-send-fill'),
Action::make('This text will be shown in the confirmation message')
->hiddenLabel('this label will not be shown in the message or the row')
->tooltip('Enviar carpeta por email')
->action( function (Expediente $record) {
$receivers = ['email' => Auth()->user()->email];
$expediente = Expediente::find($record->id);
Mail::to($receivers)->send(new ExpedienteCarpetaEmail ($expediente));
})->requiresConfirmation()
->icon('mail-send-fill'),
Now I can achieve what I wanted. Thank you.
6 replies
FFilament
Created by Albert Lens on 3/22/2024 in #❓┊help
Row action confirmation message is blank
Id I do not include a label, no message is shown as in image 01
6 replies
FFilament
Created by Albert Lens on 3/6/2024 in #❓┊help
Missing New panel resources - links don't appear on sidebar - 404-Not found
Thanks mate!!! It is a fantastic solutions just in case it happens to me again. This time I started over my project from scratch again, but this could have saved me a lot of tiem. Thanks and I'll take this into account in future.
17 replies
FFilament
Created by Albert Lens on 3/21/2024 in #❓┊help
How can I automatically launch a function when user enters a Resource list page?
Yes, I know it is a "horrible" provisional solution till I can find when the error happens. It has to be launched through serveral observers but not all of them are launching the function correctly and I have to investigate a bit more to find the error. Thanks for your approach. I put the function inside the table function (which is always called when you go to the listMyResource) and it is working fine:
public static function table(Table $table): Table
{
(new MediaService())->recalculaMediaNumExp();
return $table
->columns([
public static function table(Table $table): Table
{
(new MediaService())->recalculaMediaNumExp();
return $table
->columns([
Thanks for your help.
3 replies
FFilament
Created by Albert Lens on 3/19/2024 in #❓┊help
RenderHook css problem in login page (dark / light theme)
It works! Thank you very much.
4 replies
FFilament
Created by Nathan on 1/7/2024 in #❓┊help
Is there a way to make database notifications play sound for the $recipient?
Any solutions to this so far? I am also very interested. Tks.
11 replies
FFilament
Created by Albert Lens on 3/10/2024 in #❓┊help
Tailwind help please
Thanks for your help. Following the instructions in the OD everything is working fine.
6 replies
FFilament
Created by Albert Lens on 3/10/2024 in #❓┊help
Tailwind help please
Thank you. So, I understand that anytime I want to use Tailwind classes different from the ones initially packed with Filament, I have to create a Custom Theme, even though it is just for a bunch o classes. Is that it?
6 replies
FFilament
Created by joao nivaldo on 3/8/2024 in #❓┊help
Set Table Actions Position in v2
28 replies
FFilament
Created by joao nivaldo on 3/8/2024 in #❓┊help
Set Table Actions Position in v2
use Filament\Tables\Enums\ActionsPosition;
use Filament\Tables\Table;

public function table(Table $table): Table
{
return $table
->actions([
// ...
], position: ActionsPosition::BeforeColumns);
}
use Filament\Tables\Enums\ActionsPosition;
use Filament\Tables\Table;

public function table(Table $table): Table
{
return $table
->actions([
// ...
], position: ActionsPosition::BeforeColumns);
}
28 replies
FFilament
Created by Albert Lens on 3/7/2024 in #❓┊help
How to validate repeater items certain conditions before create - Attributes IN repeater items
Yes, tks, but I haven't found a validation rule that allows => equal to 1 or equal to another field's value, for example. Or even validation where => this fieldA must be X if model.relationship.fieldB is less than model.relationship.fieldC Maybe it is there in the Official docs, but I have not been able to find anything similar. Any help on this would be highly appreciated.
4 replies
FFilament
Created by Gandalf on 3/7/2024 in #❓┊help
How to specify ignoreRecord in unique rule in Import?
?
4 replies
FFilament
Created by Gandalf on 3/7/2024 in #❓┊help
How to specify ignoreRecord in unique rule in Import?
->unique(ignoreRecord: true)
4 replies
FFilament
Created by Albert Lens on 3/6/2024 in #❓┊help
Missing New panel resources - links don't appear on sidebar - 404-Not found
How frightening!
17 replies