renderHook scopes don't work
Hi- I'm new to this so probably doing it wrong:
in panel():
with the scopes uncommented, I would expect to see my extra stuff under client list/view/edit etc, right? if I comment out the scopes, my content appears, but otherwise it does not.
I'm freshly updated on v3.0.30 after trying this for a while on .27.
TIA for any advice!
update to add: when I @dump($scopes) in my view, it's an empty array every time.
7 Replies
In case anyone else has a similar issue - I was able to get around this. Instead of using scopes, I registered the renderHook down in the specific page where I need it.
So, in ListClients, I extend the parent mount() method:
I'm still very open to knowing what's wrong with how I was trying to use scopes before.
Edit: as a bonus, by doing this here and calling parent::mount first, I can pass the instantiated model into my view..
panels::page.end
?Thank you Leandro - that does work!
And when I dump the $scopes param now, it does contain what we'd expect-
{{ $this->record }}
in the blade file?And yes, that works too (in the specific edit/view pages that is, and we wouldnt expect it in the list view). Thanks for your help!
worked?
100% works - I can set the render hooks up at the provider level, and only show them for specific scopes as I was hoping to do. Plus the bonus of having the record available to my custom view works too.