0

I'm using this libs for managing roles on my web app: https://github.com/Zizaco/entrust

in the code I use the middleware like:

Route::group(['prefix' => 'admin', 'middleware'=>['auth','role:admin']], function () {

  Route::get('/', 'DdtsController@index');
}

and in templte the blade's function:

 @role('admin')
                <h3>Administration</h3>                
                    <ul class="nav child_menu">
                        <li><a href="/admin/users"> Gestione Utenti</a> </li>
.....
 @endrole

now I'd like to change the name of Admin to something else so I try to edit the db and these functions. As first step i try just to modify the field "display_name", thats as the doc said is even optional! And for me is even enough for my pourpose

  • name — Unique name for the Role, used for looking up role information in the application layer. For example: "admin", "owner", "employee".

  • display_name — Human readable name for the Role. Not necessarily unique and optional. For example: "User Administrator", "Project
    Owner", "Widget Co. Employee".

But no result! only blank page at login! Then I try to modify all the things (db-middleware-@role() function) with the new value...but still blank pages... there are no costumization in auth.login controller. So is about the display_name used or name? and where i can find how the affect my functions?

Laravel version 5.4 with gentellella Admin template.

JahStation
  • 893
  • 3
  • 15
  • 35
  • ps the routes all are present on the admin part, i just cut for the space of the code! – JahStation Dec 01 '17 at 14:32
  • `display_name` is optional. just change the column `name`.. – ZeroOne Dec 01 '17 at 15:10
  • I did that simpli deleting display_name and leave it empyt (is nullable) but the result is a blank page – JahStation Dec 01 '17 at 15:12
  • ok thats weird.. im also use entrust and it work.. oh ya..try this `@role(('admin'))` .. double your bracket..it case-sensitive by the way..make sure the name is the same – ZeroOne Dec 01 '17 at 15:14

0 Answers0