Override posts module views on new theme
Created 7 years ago by hugogilmar


I'm looking how to override default addons views on a new theme. For example these views: anomaly.module.posts::posts.index and anomaly.module.posts::posts.post. I already did a view override for 400 and 500 error pages on my theme overrides protected array, but I can't figure it out how to do so for an existent addon/module view (didn't works the same I guess).

Does anyone have an idea how to do this?


ryanthompson  —  7 years ago

You can override those the same but it's easier to just publish the addon and use 'pho artisan addon:publish your_addon' and edit the files dumped in resources.

There is a tweak where using twig include needs to use view(the view) so it runs through the composer. I'll try and squash that tonight though it's been a bug for a wee bit too long.

ryanthompson  —  7 years ago

And the bug I mentioned may be why the service provider method doesn't work sometimes but post what you have if you'd like me to take a look.

hugogilmar  —  7 years ago

Thanks for your feedback.

I resolved this making a plugin. I registered my custom routes and created my own controllers to handle the requests. Now I have my own logic for routes, controllers and views.

I don't know how to override the posts/ routes on admin panel for preview/view. For now I can live with that.

hugogilmar  —  7 years ago

Thanks for your help, and congrats for an awesome project!