thedevdojo / voyager

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

Route [voyager.contact.index] not defined. (View: /home/iglesia3/cyberekklesia.com/vendor/tcg/voyager/resources/views/tools/bread/index.blade.php) #5382

Closed DevHoracioRodriguez closed 3 years ago

DevHoracioRodriguez commented 3 years ago

Version information

Description

Fail to create BREAD. I was following this steps to create a Contact Form with Voyager and Laravel at devdojo. Also, followed Voyager Academy Video 08 - The BREAD Builder. On both cases, I couldn't pass creating BREAD.

Note: Laravel and Voyager was already installed and working at my hosting. I'm not using Digital Ocean.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Create New Table: Go to your Voyager admin -> Tools -> Database -> Create New Table
  2. Create a BREAD: Go to your Voyager admin -> Tools -> BREAD-> Submit
  3. Error: "Route [voyager.contact.index] not defined. (View: /home/iglesia3/cyberekklesia.com/vendor/tcg/voyager/resources/views/tools/database/index.blade.php)".
  4. By deleting contact table. Error went away and now BREAD & Database work again. Anyways, deleted modal, table and contact role/permissions.

Expected behavior

Successfully create BREAD in order to continue with step 2 to Configure the Model and the rest of the publication.

Screenshots

image

Additional context

First try: Model was configured at App/Contact.php. After error, deleted the file, the new table and permissions for the Admin Role related to Contact. Second try: I had a Contact page and menu item, so I deleted both since didn't know if had conflict with the new Contact table and BREAD. Followed Voyager Academy Video 08 - The BREAD Builder. Different from first try, I told BREAD to create Model at App/Models/Contact.php. Also, since step 4 of the article explains how to "Create and Configure your Controller" then I assumed to configure CustomController at the BREAD. See image below: image

Just in case, I'm using translation (EN, ES).

MrCrayon commented 3 years ago

Looks like you are not following Laravel naming conventions. Models are singular Contact and tables should be plural contacts.

Try again following conventions and it should work.

fletch3555 commented 3 years ago

Adding to what @MrCrayon suggested, you should not need a custom controller unless you're customizing the controller logic. But in that case, you would need to enter the fully-qualified class name (i.e. starting with App\......) in the BREAD config page, not just the class name

DevHoracioRodriguez commented 3 years ago

Looks like you are not following Laravel naming conventions. Models are singular Contact and tables should be plural contacts.

Try again following conventions and it should work.

Same result: Table plural, Model singular. Nothing else added.

DevHoracioRodriguez commented 3 years ago

Adding to what @MrCrayon suggested, you should not need a custom controller unless you're customizing the controller logic. But in that case, you would need to enter the fully-qualified class name (i.e. starting with App\......) in the BREAD config page, not just the class name

Thank you for the info. Will have it in mind. Anyways, did try without custom cotroller. Same result. Same error.

MrCrayon commented 3 years ago

Delete the menu item or try on a fresh install, I suspect you are still using the old generated menu item.

DevHoracioRodriguez commented 3 years ago

@MrCrayon , reviewed tables. Old items (created from Menu Builder) weren't there. I tried with new different name table following naming standard then creating the BREAD but failed on BREAD Submission. All options were default.

My observation: Table, model, menu_items, permission and permission_roles all were created.

All deleted now in order to database and BREAD work again.

MrCrayon commented 3 years ago

Please do a fresh install and report exactly all the steps you are doing with name of table etc. and eventually the error you get. In your first post you wrote

I told BREAD to create Model at App/Models/Contact.php

But BREAD does not create Models, I think the model can be created when you create the table or you need to create it yourself.

DevHoracioRodriguez commented 3 years ago

Did a fresh install but with Wave! Did some test and the error isn't appearing anymore. Will try again after applying custom changes. If error appears again then will open another case. Thank you for the support.

github-actions[bot] commented 1 year 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.