Fix SpiceChart: encode URL array as JSON.parse() to avoid double quotes breaking x-data HTML attribute
Deploy / deploy (push) Successful in 16s
Deploy / deploy (push) Successful in 16s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
118552d093
commit
8f7af41513
1 file changed
+5
-2
@@ -4,6 +4,7 @@ namespace App\Filament\User\Resources\SpiceResource\Widgets;
|
|||||||
|
|
||||||
use Leandrocfe\FilamentApexCharts\Widgets\ApexChartWidget;
|
use Leandrocfe\FilamentApexCharts\Widgets\ApexChartWidget;
|
||||||
use Filament\Support\RawJs;
|
use Filament\Support\RawJs;
|
||||||
|
use Illuminate\Support\Js;
|
||||||
use App\Models\Spice;
|
use App\Models\Spice;
|
||||||
|
|
||||||
class SpiceChart extends ApexChartWidget
|
class SpiceChart extends ApexChartWidget
|
||||||
@@ -61,11 +62,13 @@ class SpiceChart extends ApexChartWidget
|
|||||||
|
|
||||||
protected function extraJsOptions(): ?RawJs
|
protected function extraJsOptions(): ?RawJs
|
||||||
{
|
{
|
||||||
$urls = Spice::orderBy('id')
|
$urls = Js::from(
|
||||||
|
Spice::orderBy('id')
|
||||||
->get()
|
->get()
|
||||||
->map(fn ($spice) => url('/dashboard/rohstoffe/' . $spice->id . '/edit'))
|
->map(fn ($spice) => url('/dashboard/rohstoffe/' . $spice->id . '/edit'))
|
||||||
->values()
|
->values()
|
||||||
->toJson();
|
->toArray()
|
||||||
|
);
|
||||||
|
|
||||||
return RawJs::make(<<<JS
|
return RawJs::make(<<<JS
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user