| 
                    1
                 | 
                                    
                                                     | 
                
                 | 
                <?php namespace Arcanesoft\Auth\Http\Routes\Foundation;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    2
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    3
                 | 
                                    
                                                     | 
                
                 | 
                use Arcanedev\Support\Bases\RouteRegister;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    4
                 | 
                                    
                                                     | 
                
                 | 
                use Arcanesoft\Auth\Models\Role;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    5
                 | 
                                    
                                                     | 
                
                 | 
                use Illuminate\Contracts\Routing\Registrar;  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    6
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    7
                 | 
                                    
                                                     | 
                
                 | 
                /**  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    8
                 | 
                                    
                                                     | 
                
                 | 
                 * Class     RolesRoutes  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    9
                 | 
                                    
                                                     | 
                
                 | 
                 *  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    10
                 | 
                                    
                                                     | 
                
                 | 
                 * @package  Arcanesoft\Auth\Http\Routes\Foundation  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    11
                 | 
                                    
                                                     | 
                
                 | 
                 * @author   ARCANEDEV <[email protected]>  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    12
                 | 
                                    
                                                     | 
                
                 | 
                 */  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    13
                 | 
                                    
                                                     | 
                
                 | 
                class RolesRoutes extends RouteRegister  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    14
                 | 
                                    
                                                     | 
                
                 | 
                { | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    15
                 | 
                                    
                                                     | 
                
                 | 
                    /* ------------------------------------------------------------------------------------------------  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    16
                 | 
                                    
                                                     | 
                
                 | 
                     |  Main Functions  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    17
                 | 
                                    
                                                     | 
                
                 | 
                     | ------------------------------------------------------------------------------------------------  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    18
                 | 
                                    
                                                     | 
                
                 | 
                     */  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    19
                 | 
                                    
                                                     | 
                
                 | 
                    /**  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    20
                 | 
                                    
                                                     | 
                
                 | 
                     * Map routes.  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    21
                 | 
                                    
                                                     | 
                
                 | 
                     *  | 
            
            
                                                                                                            
                            
            
                                    
            
            
                | 
                    22
                 | 
                                    
                                                     | 
                
                 | 
                     * @param  \Illuminate\Contracts\Routing\Registrar  $router  | 
            
            
                                                                                                            
                                                                
            
                                    
            
            
                | 
                    23
                 | 
                                    
                                                     | 
                
                 | 
                     */  | 
            
            
                                                        
            
                                    
            
            
                | 
                    24
                 | 
                                    
                             24                          | 
                
                 | 
                    public function map(Registrar $router)  | 
            
            
                                                        
            
                                    
            
            
                | 
                    25
                 | 
                                    
                                                     | 
                
                 | 
                    { | 
            
            
                                                        
            
                                    
            
            
                | 
                    26
                 | 
                                    
                             24                          | 
                
                 | 
                        $this->bind('auth_role', function($hashedId) { | 
            
            
                                                        
            
                                    
            
            
                | 
                    27
                 | 
                                    
                             24                          | 
                
                 | 
                            return Role::firstHashedOrFail($hashedId);  | 
            
            
                                                        
            
                                    
            
            
                | 
                    28
                 | 
                                    
                             18                          | 
                
                 | 
                        });  | 
            
            
                                                        
            
                                    
            
            
                | 
                    29
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                        
            
                                    
            
            
                | 
                    30
                 | 
                                    
                             24                          | 
                
                 | 
                        $this->group(['prefix' => 'roles', 'as' => 'roles.'], function () { | 
            
            
                                                        
            
                                    
            
            
                | 
                    31
                 | 
                                    
                             24                          | 
                
                 | 
                            $this->get('/', 'RolesController@index') | 
            
            
                                                        
            
                                    
            
            
                | 
                    32
                 | 
                                    
                             18                          | 
                
                 | 
                                 ->name('index'); // auth::foundation.roles.index | 
            
            
                                                        
            
                                    
            
            
                | 
                    33
                 | 
                                    
                             18                          | 
                
                 | 
                 | 
            
            
                                                        
            
                                    
            
            
                | 
                    34
                 | 
                                    
                                                     | 
                
                 | 
                            $this->get('create', 'RolesController@create') | 
            
            
                                                        
            
                                    
            
            
                | 
                    35
                 | 
                                    
                             24                          | 
                
                 | 
                                 ->name('create'); // auth::foundation.roles.create | 
            
            
                                                        
            
                                    
            
            
                | 
                    36
                 | 
                                    
                             24                          | 
                
                 | 
                 | 
            
            
                                                        
            
                                    
            
            
                | 
                    37
                 | 
                                    
                             18                          | 
                
                 | 
                            $this->post('store', 'RolesController@store') | 
            
            
                                                        
            
                                    
            
            
                | 
                    38
                 | 
                                    
                             18                          | 
                
                 | 
                                 ->name('store'); // auth::foundation.roles.store | 
            
            
                                                        
            
                                    
            
            
                | 
                    39
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                        
            
                                    
            
            
                | 
                    40
                 | 
                                    
                             24                          | 
                
                 | 
                            $this->group(['prefix' => '{auth_role}'], function () { | 
            
            
                                                        
            
                                    
            
            
                | 
                    41
                 | 
                                    
                             24                          | 
                
                 | 
                                $this->get('/', 'RolesController@show') | 
            
            
                                                        
            
                                    
            
            
                | 
                    42
                 | 
                                    
                             18                          | 
                
                 | 
                                     ->name('show'); // auth::foundation.roles.show | 
            
            
                                                        
            
                                    
            
            
                | 
                    43
                 | 
                                    
                             18                          | 
                
                 | 
                 | 
            
            
                                                        
            
                                    
            
            
                | 
                    44
                 | 
                                    
                                                     | 
                
                 | 
                                $this->get('edit', 'RolesController@edit') | 
            
            
                                                        
            
                                    
            
            
                | 
                    45
                 | 
                                    
                             24                          | 
                
                 | 
                                     ->name('edit'); // auth::foundation.roles.edit | 
            
            
                                                        
            
                                    
            
            
                | 
                    46
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                        
            
                                    
            
            
                | 
                    47
                 | 
                                    
                                                     | 
                
                 | 
                                $this->put('update', 'RolesController@update') | 
            
            
                                                        
            
                                    
            
            
                | 
                    48
                 | 
                                    
                             24                          | 
                
                 | 
                                     ->name('update'); // auth::foundation.roles.update | 
            
            
                                                        
            
                                    
            
            
                | 
                    49
                 | 
                                    
                             24                          | 
                
                 | 
                 | 
            
            
                                                        
            
                                    
            
            
                | 
                    50
                 | 
                                    
                             18                          | 
                
                 | 
                                $this->put('activate', 'RolesController@activate') | 
            
            
                                                        
            
                                    
            
            
                | 
                    51
                 | 
                                    
                             18                          | 
                
                 | 
                                     ->name('activate'); // auth::foundation.roles.activate | 
            
            
                                                        
            
                                    
            
            
                | 
                    52
                 | 
                                    
                                                     | 
                
                 | 
                 | 
            
            
                                                        
            
                                    
            
            
                | 
                    53
                 | 
                                    
                             24                          | 
                
                 | 
                                $this->delete('delete', 'RolesController@delete') | 
            
            
                                                        
            
                                    
            
            
                | 
                    54
                 | 
                                    
                             24                          | 
                
                 | 
                                     ->name('delete'); // auth::foundation.roles.delete | 
            
            
                                                        
            
                                    
            
            
                | 
                    55
                 | 
                                    
                             18                          | 
                
                 | 
                            });  | 
            
            
                                                        
            
                                    
            
            
                | 
                    56
                 | 
                                    
                             18                          | 
                
                 | 
                        });  | 
            
            
                                                        
            
                                    
            
            
                | 
                    57
                 | 
                                    
                                                     | 
                
                 | 
                    }  | 
            
            
                                                        
            
                                    
            
            
                | 
                    58
                 | 
                                    
                                                     | 
                
                 | 
                }  | 
            
            
                                                        
            
                                    
            
            
                | 
                    59
                 | 
                                    
                                                     | 
                
                 | 
                 |