It is possible do use __construct on Edit Page?
I'm using a service on a __construct inside a create page, and it is working like a charm.
But when I use it in a EditPage, I have this error message
Target [App\Http\Services\PaymentTransaction\PaymentTransactionServiceContract] is not instantiable while building [App\Filament\Resources\PaymentIntentionResource\Pages\EditPaymentIntention].
2 Replies
Are you using panels? If so the page is the livewire component and you should be handling the logic in mount() and not __construct()
Solution
Ok I tryed it:
But it still not working, and I solved using app()->make() directly on beforeSave() method..
Something like this:
Nice hint @awcodes 🙏