middleware case sensitive #2357
-
I have created a Role Field when i used Screenshot: Please help how to solve this problem |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
You must forget cache after manually changes, read documentation about that |
Beta Was this translation helpful? Give feedback.
-
If you've configured your database to use a Case-Sensitive character-set, then searches/lookups will be case-sensitive. I recommend you not allow users/administrators to change the name of the roles, since your application code can't be guaranteed to match. Perhaps a better option would be to give your administrators a drop-down list of roles to choose from, instead of typing them in manually? |
Beta Was this translation helpful? Give feedback.
-
Another idea: you could change your middleware to list multiple forms/spellings of the role name: -['auth','role:field']]
+['auth','role:field|Field']] As Erikn69 noted, the problem with that is you would need to do the same in Blade and Policies and Controllers, everywhere. |
Beta Was this translation helpful? Give feedback.
If you've configured your database to use a Case-Sensitive character-set, then searches/lookups will be case-sensitive.
I recommend you not allow users/administrators to change the name of the roles, since your application code can't be guaranteed to match.
Perhaps a better option would be to give your administrators a drop-down list of roles to choose from, instead of typing them in manually?