CORONEL
CORONEL
FFilament
Created by rogazth on 6/22/2024 in #❓┊help
Chart widget with chart.js plugins
For anybody going through this same issue while trying to use chartjs-datalabels-plugin. This is a issue with chartjs-datalabels-plugin itself, and only happen for doughnut and pie charts. I don't think anybody there will fix it, the Repo is pretty much idle. I found an alternative that 'kinda' works: chart.js-plugin-labels-dv After installing the package through npm, the .js file will be like this:
import { getChartLabelPlugin } from "chart.js-plugin-labels-dv";

window.filamentChartJsPlugins ??= [];
window.filamentChartJsPlugins.push(getChartLabelPlugin());
import { getChartLabelPlugin } from "chart.js-plugin-labels-dv";

window.filamentChartJsPlugins ??= [];
window.filamentChartJsPlugins.push(getChartLabelPlugin());
14 replies
FFilament
Created by King Dice on 7/10/2024 in #❓┊help
Brainstorming ways to solve this problem
If you want it "future proof", i say go with Browsershot and Puppeteer. But give Laravel Snappy a shot, if it renders your html/css the way it should, the ease of use and performance pays off.
14 replies
FFilament
Created by wazkaz on 7/2/2024 in #❓┊help
Custom table in the resource page
Maybe you will be better off creating a custom page. You can extend its class from one of the base resource pages of Filament (like EditRecord, etc) to have the base functionality of forms, tables and RelationManagers, and then easily add your custom stuff on top.
6 replies
FFilament
Created by Alnuaimi on 7/10/2024 in #❓┊help
React pdf with filamentphp
If all you want is to generate PDF's, search for Laravel Snappy, or Browsershot, or DomPDF.
4 replies
FFilament
Created by Jamie Cee on 7/10/2024 in #❓┊help
Reactive filter updating
->live() on the 'client' select?
5 replies
FFilament
Created by King Dice on 7/10/2024 in #❓┊help
Brainstorming ways to solve this problem
wkhtmltopdf works flawlessly, it's available on major Linux repos, through composer, and other sources. It's a very nice midpoint between DomPDF and full out headless Chrome. The risk of breaking in the future totally worth it! 😁
14 replies
FFilament
Created by Matteo G on 7/10/2024 in #❓┊help
Relation Manager and HasManyThrough: General error: 1 no such column on one of the models
Your relationships is wrong. You don't need hasManyThrough, you structure looks to me like a belongsToMany. Get a grip on that first... That's Laravel 101, nothing to do with Filament.
6 replies
FFilament
Created by Hiteksha on 7/10/2024 in #❓┊help
How can i display products in order table & add product filter in order page?
You gonna have to describe much better what you trying to accomplish, and what you already got. We can't even tell if its related do Filamentphp or not...
13 replies
FFilament
Created by lmtc on 7/10/2024 in #❓┊help
Auto add empty repeater based on a value in another field
Have you tried ->live() on the select, than using (Get $get) on the repeater to access its value?
4 replies
FFilament
Created by King Dice on 7/10/2024 in #❓┊help
Brainstorming ways to solve this problem
If your html/css is not too "fancy" (css3 flexbox etc) you can use Laravel Snappy https://github.com/barryvdh/laravel-snappy which uses wkhtmltopdf bin, and is WAYYYYYY faster than using headless chrome, and way more accurate than using DomPDF. The part of generating the layouts based on data, is straight forward Laravel+Blade.
14 replies
FFilament
Created by CORONEL on 7/9/2024 in #❓┊help
Open custom modal from anywhere
No description
6 replies
FFilament
Created by CORONEL on 7/9/2024 in #❓┊help
Open custom modal from anywhere
Yeah, after a little more digging, i thought the same. I'm trying to get it done using RenderHooks, i'll post the code if its successful!
6 replies
FFilament
Created by CORONEL on 6/20/2024 in #❓┊help
Get active relation manager table filters from custom page
For anyone having the same questions, i'll post what i ended up doing. What i wanted was to get the relation manager table filters from my custom page which they were shown. My solution was the following: I'm using
AnourValar\EloquentSerialize
AnourValar\EloquentSerialize
library to serialize the query builder and save it to the application cache. So in the Relation Manager table, i do the following:
$table...->filtersApplyAction(function ($livewire) {
$serialized = EloquentSerializeFacade::serialize($livewire->getFilteredTableQuery());
Cache::put(get_class($livewire), $serialized);
$livewire->dispatch('refreshPage');
})
$table...->filtersApplyAction(function ($livewire) {
$serialized = EloquentSerializeFacade::serialize($livewire->getFilteredTableQuery());
Cache::put(get_class($livewire), $serialized);
$livewire->dispatch('refreshPage');
})
And in my custom page, i have the following:
protected $listeners = ['refreshPage' => '$refresh'];

public function myMethodWhereINeedTheFilters(){
$activeRelationManager = $this->getRelationManagers()[$this->activeRelationManager];
$filtered = null;
try {
$filtered = EloquentSerializeFacade::unserialize(Cache::get($activeRelationManager));
} catch (Exception $e) {
}
// dd($filtered);

if ($filtered) {
$pointsQuery = $filtered;
} else {
$pointsQuery = $this->record->points();
}

$data = $pointsQuery->get();
}
protected $listeners = ['refreshPage' => '$refresh'];

public function myMethodWhereINeedTheFilters(){
$activeRelationManager = $this->getRelationManagers()[$this->activeRelationManager];
$filtered = null;
try {
$filtered = EloquentSerializeFacade::unserialize(Cache::get($activeRelationManager));
} catch (Exception $e) {
}
// dd($filtered);

if ($filtered) {
$pointsQuery = $filtered;
} else {
$pointsQuery = $this->record->points();
}

$data = $pointsQuery->get();
}
5 replies
FFilament
Created by CORONEL on 6/20/2024 in #❓┊help
Get active relation manager table filters from custom page
And setting them using the custom page
public static function getRelations(): array{...}
public static function getRelations(): array{...}
method.
5 replies
FFilament
Created by CORONEL on 6/20/2024 in #❓┊help
Get active relation manager table filters from custom page
PS: I'm adding the relation managers to the custom page like this:
@php
$relationManagers = $this->getRelationManagers();
@endphp


@if (count($relationManagers))
<x-filament-panels::resources.relation-managers :active-locale="isset($activeLocale) ? $activeLocale : null"
:active-manager="$this->activeRelationManager ?? array_key_first($relationManagers)" :content-tab-label="$this->getContentTabLabel()"
:content-tab-contained="true" :managers="$relationManagers" :owner-record="$record" :page-class="static::class">
</x-filament-panels::resources.relation-managers>
@endif
@php
$relationManagers = $this->getRelationManagers();
@endphp


@if (count($relationManagers))
<x-filament-panels::resources.relation-managers :active-locale="isset($activeLocale) ? $activeLocale : null"
:active-manager="$this->activeRelationManager ?? array_key_first($relationManagers)" :content-tab-label="$this->getContentTabLabel()"
:content-tab-contained="true" :managers="$relationManagers" :owner-record="$record" :page-class="static::class">
</x-filament-panels::resources.relation-managers>
@endif
5 replies
FFilament
Created by datarecall on 3/4/2024 in #❓┊help
Custom Page Table Actions Help - still broken
Ok, i got it working for my use case. I was declaring the table->query() to a relation query, just replacing it by table->relationship(...) made it work.
23 replies
FFilament
Created by datarecall on 3/4/2024 in #❓┊help
Custom Page Table Actions Help - still broken
@datarecall , did you figured it out? I'm facing the same behaviour when trying to call a table action from a custom component table.
23 replies