👻
VILT Stack Generator
  • Get Started
    • 👻Overview
    • 💻Environment Setup
    • 🚀Install
  • Generate
    • 🧠Resource
    • 🔥Action
    • 🧩Modal
    • 📈Widget
    • 📏Route
    • 🖥️Views
    • 🔒Roles
  • Resource
    • 🔦Using
    • 🪝Hooks
    • 📤Import & Export
  • Builders
    • 🔡Form
    • 📺Table
    • 📄Page
  • Components
    • 💫Using
    • 🆎Text
    • 🔤Textarea
    • 🔠Rich
    • 🔢Number
    • 📞Tel
    • ✉️Email
    • 🔄Toggle
    • 🖌️Color
    • 📅Date
    • ⌛Time
    • ⏲️DateTime
    • ⚡Select
    • 🔁Repeater
    • 📑Schema
    • ✨Section
    • 🖼️Media
    • 💟HasOne
    • 🎁Relation
  • Managers
    • 🔤Translation
    • 📖Menu
    • ♠️Share
  • Helpers
    • ⚠️Alert
    • 💻Render
    • 🌠Actions
    • 🌟Modal
  • Plugins
    • 🔤Translations
    • 📀Settings
    • 📖Menus
    • 🔔Notifications
    • 💳Payment
    • 🏗️Build Plugins
  • Learning
    • 🙏Task To Get Start
    • 🚨CI/CD
    • 🦄Awesome TailwindCSS
Powered by GitBook
On this page
  • Install Roles Plugin
  • Roles Methods
  • Generate Permission
  1. Generate

Roles

PreviousViewsNextUsing

Last updated 2 years ago

we build a plugin for user ACL build in so you can use the full package feature

Install Roles Plugin

you can install roles plugin by run this command

php artisan roles:install

this command will install default roles and permissions for admin user and seed a user for you the use will be

email: admin@admin.com

password: QTS@2022

Roles Methods

we build some methods to help you, on every Resource.vue you will get a 6 var

canView //= view_TABLE on permission table
canViewAny //= view_any_TABLE on permission table
canCreate //= create_TABLE on permission table
canEdit //= update_TABLE on permission table
canDelete //= delete_TABLE on permission table
canDeleteAny //= delete_any_TABLE on permission table

so you can use it to handle what the end-user sees when he has selected permission.

and for menus you can handle permission using ->can() with the permission name init

on the Resource.vue the base view of the generator you can use this way to set your permission

public function rows(){
    $this->canView = false;
    return [];
}

by this way you can control what the end-user sees.

Generate Permission

you can generate permission for a selected table if not exists and append it to the main admin role using this command

php artisan roles:generate table

where table is the name of the table you when to use it

🔒
spatie/laravel-permission