FilamentF
Filament2y ago
vas

Attempted to lazy load [payment] on model [App\Models\Order] but lazy loading is disabled.

i have the following action in the OrderResource

                Tables\Actions\Action::make('Download Factura')
                    ->icon('heroicon-o-credit-card')
                    ->color('indigo')
                    ->hidden(fn (Order $order) => $order->payment->status != PaymentStatusEnum::PAID->value)
                    ->url(fn (Order $order) => route('stripe.retrieve.invoice', $order->payment))
                    ->openUrlInNewTab(),


Route::get('/stripe/retrieve_invoice/{payment}', 'App\Http\Controllers\StripeController@retrieve_invoice')->name('stripe.retrieve.invoice');


as you can see im trying to pass the payment to that route
normally i would have
Order::with('payment')

how can i achieve this in filament
Thank you
Was this page helpful?