laravel-acl icon indicating copy to clipboard operation
laravel-acl copied to clipboard

Can't delete slug

Open t2thec opened this issue 8 years ago • 2 comments
trafficstars

Hi ya,

Thanks for the great package! really nice to work with.

I've noticed in \Kodeine\Acl\Models\Eloquent\Permissionthat when updating the slug, it adds any new items, but won't allow deletion.

I presume this is correct behaviour and is in place to prevent people messing things up?

Personally, I would like the ability to delete the slug. However, this is pretty trivial in the DB.

Any thoughts?

Thanks again.

t2thec avatar Mar 31 '17 09:03 t2thec

Same problem here.

fontenele avatar Mar 17 '18 17:03 fontenele

To update permission slugs i had to save clean slug before save my new slugs, Permissions have a SetMutator in slug attribute, so its always sync with original values stored on model.

Resolved with the code:


$permission->slug = '';
$permission->save();
$permission->slug = $post['slug'];

fontenele avatar Mar 17 '18 18:03 fontenele