Question on backpack.base.setup_my_account_routes using existing crud pre-loaded for current user. #506
Replies: 2 comments
-
Hello @gregraab thanks for the question. I think you can configure the save actions with: https://backpackforlaravel.com/docs/5.x/crud-save-actions#save-actions-api-1 Let me know if you have any issues. Cheers |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm closing this issue due to inactivity. If you need further assistance or have additional questions, feel free to reopen this issue or create a new one. We're here to help! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Will try to explain this as succinctly as possible.
Have a backpack app that in its simplest form is an employee tracker. An employee can have access to this and if they do they would have a record in both the Employee table and the User table. The main crud is quite large and involved.
For some public facing data, the Employee has a Profile in a related table, but also has need to edit some of the base fields from the Employee table itself. This has been implemented by creating a new Profiles Crud controller that inherits from the Employee crud controller because we have a role of user that needs to have a list view of all profiless and be able search by Employee Name etc and edit them directly. Profile crud has it's own list view and a very simplified edit crud with the Profile fields and a few of the Employee fields. This all works fine. (But could be changed if it makes sense to do it a different way).
I now need to implement the ability of a logged in user to edit their own profile. I would like to use the same form from the Profiles crud controller and access through the MyAccountController drop down. backpack.base.setup_my_account_routes is set to false and set the route to ProfileCrudController edit which works. But on save, it saves, but then routes back to list, which most users would not have access to. Ideally want it to route back to view they were on when they clicked on Edit My Profile, but main page would be acceptable. What combo or routes, overriding actions, etc. do I need to do to get this to work. I feel like I am missing one simple thing. It should be easy... I think.
Beta Was this translation helpful? Give feedback.
All reactions