Edit Resource model
Hello again everyone.
can i edit the model of a given resource as shown in the attached file on line 18?
15 Replies
Of course..
What are you trying to do?
@toeknee_iom I want to point this Resource to \App\Models\MainWarehouse::class
It's already going there....
I want to make several resources which are pointing to one Model but based on record status!
it is failing when I am trying to open the creation modal
The use at the top shows it's using that model.
What is failing, can you provide more context
this is the error I am getting
That is going to a different Model
That's not a Resource! It's a page.
can't I have one model( MainWarehouse::class ) to be used by 2 or more resources?
Sure you can.
You can sure
I have one model in 50 resources for one project lols
But you need to define the Model Class in the resource, you are defining it in the list / page
The sub pages reference the resource always to reduce duplication of code
Ooooh sure @toeknee_iom
Thanks for this. it is working now!
I was defining the $model in page not in resource
but when i try to open the modal for creating I still got some issues
You haven't included the
God bless you @toeknee_iom @Dennis Koch
it is working perfectly now