thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.78k stars 2.67k forks source link

how do i create a custom view and controller? #3362

Closed ghost closed 6 years ago

ghost commented 6 years ago

Version information

Description of problem

Is there a way to create a custom view and controller? i tried following the documentation here https://voyager.readme.io/docs/using-custom-http-controllers but it is very brief as i am ensure of what i should do. I have tried creating a resource controller and a blade file in the app\resources\views and added in web.php file but whenever i try to access the url it says "Sorry, the page you are looking for could not be found."

fletch3555 commented 6 years ago

Latest is not a valid version for Voyager. Please make sure all issues include the appropriate information.

For your issue, our apologies, that documentation is out of date anyway. If you want a custom controller, then just create it, extending TCG\Voyager\Http\Controllers\BaseController. That controller will automatically try to find the default views under the voyager namespace, so you can override them by custom view files at resources/views/vendor/voyager/[BREAD slug name]/[action].blade.php, where [action] is either browse, read, or edit-add. If you need anything more custom, you're free to expand on this with your own.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.