Skip to content

tiaxter/laravel-permission-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

💡 Purpose

This package permit to check user permissions, managed by spatie/laravel-permission package, directly from JS.

🚀 Installation

  • First of all, you can install the package using composer

    composer require tiaxter/laravel-permission-js
  • This step can be skipper if auto-discovery is enabled

    Add package service provider into config/app.php file

    'providers' => [
          ..., 
          Tiaxter\LaravelPermissionJs\LaravelPermissionJsServiceProvider::class
    ];

🔰 Getting started

First of all you have to include this Blade Directive inside the page where you want to use this package

@permissions

💻 Basic usage

  • If you're using TypeScript you will need to add this line at start of your script:
    declare function can(permissionName: string): bool

Checking logged in user permission

    const canUserDoSomething = can('permission name here'); // true or false

🎨 Credits

About

Check user permissions directly on JS

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages