03 THIS ACTION IS UNAUTHORIZED
Closed this issue · 2 comments
Prerequisites
Please answer the following questions for yourself before submitting an issue.
- [ x] I am running the latest version
- [ x] I checked the documentation and found no answer
- [x ] I checked to make sure that this issue has not already been filed
- [x ] I'm reporting the issue to the correct repository (for multi-repository projects)
Expected Behavior
When I click Edit or Destroy in my new table it should load the edit page or destroy the record and load the index.blade.php
Current Behavior
The model is called Friends
bnargon.zip
issuesfiles.zip
I can not get the edit or destroy to work for my new table. I can ADD records fine but when I click on Edit or Delete I get 403 THIS ACTION IS UNAUTHORIZED. I don't know what I am missing. Paul
Failure Information (for bugs)
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
- create new model
- create new controller
- create new policy
- create new request
- migrate table
- create new folder with index, edit and create files
- add new policy to auth service provider
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
- Device:
- Operating System:
- Browser and Version:
Failure Logs
Please include any relevant log snippets or files here.
Hello and thanks for using our products.
Your problem is caused by the laravel naming convention, the models should be at singular, so the Friends should became Friend. You have to change the names on all your files which contains "friends" to "friend" and controller/policies variables from $friends to $friend.
Also, you have to add the policy in AuthServiceProvider
Best
thank you this worked.