dimanche 2 juin 2019

Shinobi Can restriction from vue.js component

I'm working with laravel 5.7 and vue.js, with shinobi package, I'm restricting the users access.

When I try to hide button (new button), to create categories which one is in Categoria.vue component, but doesn't recognize the helper @can

Code for web.php: My route

I hope you can help me

Code for web.php: My route

Route::middleware(['auth'])->group(function(){

//CATEGORIAS
route::post('/categoria/registrar', 'CategoryController@store')->name('categoria.registrar')
->middleware('permission:categoria.registrar');
.........
}

Code of Categoria.vue component

Div (here is the button):

<div class="card-header">
<i class="fa fa-align-justify"></i> Categorías
@can('categoria.registrar')
<button type="button" @click="abrirModal('categoria', 'registrar')" class="btn btn-secondary">
<i class="icon-plus"></i>&nbsp;Nuevo
</button>
@endcan
</div>

enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire