database/seeders/RolesPermisosTableSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $rol_vendedor = Role::create(['name' => 'Vendedor']);
        $rol_cliente = Role::create(['name' => 'Cliente']);
        $permission = Permission::create(['name' => 'productos.index']);
        $rol_vendedor->givePermissionTo($permission);
        $rol_cliente->givePermissionTo($permission);
        $permission = Permission::create(['name' => 'productos.show']);
        $rol_vendedor->givePermissionTo($permission);
        $rol_cliente->givePermissionTo($permission);
        $permission = Permission::create(['name' => 'productos.create']);
        $rol_vendedor->givePermissionTo($permission);
        $permission = Permission::create(['name' => 'productos.store']);
        $rol_vendedor->givePermissionTo($permission);
        $permission = Permission::create(['name' => 'productos.edit']);
        $rol_vendedor->givePermissionTo($permission);
        $permission = Permission::create(['name' => 'productos.update']);
        $rol_vendedor->givePermissionTo($permission);
        $permission = Permission::create(['name' => 'productos.destroy']);
        $rol_vendedor->givePermissionTo($permission);
    }
public function run ( ) { $ rol_vendedor = Role :: create ( [ 'name' => 'Vendedor' ] ) ; $ rol_cliente = Role :: create ( [ 'name' => 'Cliente' ] ) ; $ permission = Permission :: create ( [ 'name' => 'productos.index' ] ) ; $ rol_vendedor -> givePermissionTo ( $ permission ) ; $ rol_cliente -> givePermissionTo ( $ permission ) ; $ permission = Permission :: create ( [ 'name' => 'productos.show' ] ) ; $ rol_vendedor -> givePermissionTo ( $ permission ) ; $ rol_cliente -> givePermissionTo ( $ permission ) ; $ permission = Permission :: create ( [ 'name' => 'productos.create' ] ) ; $ rol_vendedor -> givePermissionTo ( $ permission ) ; $ permission = Permission :: create ( [ 'name' => 'productos.store' ] ) ; $ rol_vendedor -> givePermissionTo ( $ permission ) ; $ permission = Permission :: create ( [ 'name' => 'productos.edit' ] ) ; $ rol_vendedor -> givePermissionTo ( $ permission ) ; $ permission = Permission :: create ( [ 'name' => 'productos.update' ] ) ; $ rol_vendedor -> givePermissionTo ( $ permission ) ; $ permission = Permission :: create ( [ 'name' => 'productos.destroy' ] ) ; $ rol_vendedor -> givePermissionTo ( $ permission ) ; }
Run the database seeds.
Run the database seeds .