bantenprov / vue-trust
Manage trust using vuejs
Installs: 40
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 4
Open Issues: 1
Language:Vue
Requires
- php: >=5.6.4
- illuminate/support: 5.4.*
This package is not auto-updated.
Last update: 2024-12-22 06:37:07 UTC
README
Manage laravel permission using vuejs
Install via composer
$ composer require bantenprov/vue-trust:dev-master
Edit config/app.php
'providers' => [ /* * Application Service Providers... */ App\Providers\AppServiceProvider::class, App\Providers\AuthServiceProvider::class, // App\Providers\BroadcastServiceProvider::class, App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, //................ Bantenprov\VueTrust\VueTrustServiceProvider::class,
publish asset
$ php artisan vendor:publish --tag=vue-trust-assets
tambahkan pada resources/assets/js/routes/routes.js
...authGuard([ { path: '/admin', name: 'admin', redirect: '/admin/dashboard', component: layout('Default'), children: [ //=== vue trust route { path: '/admin/vue-trust/role', components: { main: resolve => require(['~/components/bantenprov/vue-trust/role/role.index.vue'], resolve), navbar: resolve => require(['~/components/Navbar.vue'], resolve), sidebar: resolve => require(['~/components/Sidebar.vue'], resolve) }, meta: { title: "Role" } }, { path: '/admin/vue-trust/role/create', components: { main: resolve => require(['~/components/bantenprov/vue-trust/role/role.create.vue'], resolve), navbar: resolve => require(['~/components/Navbar.vue'], resolve), sidebar: resolve => require(['~/components/Sidebar.vue'], resolve) }, meta: { title: "Role" } }, { path: '/admin/vue-trust/role/:id/set-permission', components: { main: resolve => require(['~/components/bantenprov/vue-trust/role/role.setpermission.vue'], resolve), navbar: resolve => require(['~/components/Navbar.vue'], resolve), sidebar: resolve => require(['~/components/Sidebar.vue'], resolve) }, meta: { title: "Role" } }, { path: '/admin/vue-trust/role/:id/show', components: { main: resolve => require(['~/components/bantenprov/vue-trust/role/role.show.vue'], resolve), navbar: resolve => require(['~/components/Navbar.vue'], resolve), sidebar: resolve => require(['~/components/Sidebar.vue'], resolve) }, meta: { title: "Role" } }, { path: '/admin/vue-trust/role/:id/edit', components: { main: resolve => require(['~/components/bantenprov/vue-trust/role/role.edit.vue'], resolve), navbar: resolve => require(['~/components/Navbar.vue'], resolve), sidebar: resolve => require(['~/components/Sidebar.vue'], resolve) }, meta: { title: "Role" } }, { path: '/admin/vue-trust/permission', components: { main: resolve => require(['~/components/bantenprov/vue-trust/permission/permission.index.vue'], resolve), navbar: resolve => require(['~/components/Navbar.vue'], resolve), sidebar: resolve => require(['~/components/Sidebar.vue'], resolve) }, meta: { title: "Permission" } }, { path: '/admin/vue-trust/permission/create', components: { main: resolve => require(['~/components/bantenprov/vue-trust/permission/permission.create.vue'], resolve), navbar: resolve => require(['~/components/Navbar.vue'], resolve), sidebar: resolve => require(['~/components/Sidebar.vue'], resolve) }, meta: { title: "Permission" } }, { path: '/admin/vue-trust/permission/:id/show', components: { main: resolve => require(['~/components/bantenprov/vue-trust/permission/permission.show.vue'], resolve), navbar: resolve => require(['~/components/Navbar.vue'], resolve), sidebar: resolve => require(['~/components/Sidebar.vue'], resolve) }, meta: { title: "Permission" } }, { path: '/admin/vue-trust/permission/:id/edit', components: { main: resolve => require(['~/components/bantenprov/vue-trust/permission/permission.edit.vue'], resolve), navbar: resolve => require(['~/components/Navbar.vue'], resolve), sidebar: resolve => require(['~/components/Sidebar.vue'], resolve) }, meta: { title: "Permission" } }, //=== end vue trust route
tambahkan pada resources/assets/js/app.js
//....... //== vue trust menus import vuetrust_menu from './components/bantenprov/vue-trust/vuetrust_menu';
run dev ( development )
$ npm run dev
lanjutkan install laratrust
instalasi dan pengaturan laratust dapat dilihat disini
setelah install dan kofigurasi laratrust
lanjutkan :
Edit app/Role.php & app/Permission.php
<?php namespace App; use Laratrust\Models\LaratrustRole; class Role extends LaratrustRole { public $fillable = ['name', 'display_name', 'description']; }
<?php namespace App; use Laratrust\Models\LaratrustPermission; class Permission extends LaratrustPermission { public $fillable = ['name', 'display_name', 'description']; }