mkinyua53 / laravel-vue-boilerplate
A Laravel & Vue Quickstart.
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=7.0.0
- barryvdh/laravel-ide-helper: ^2.6
- fideloper/proxy: ~3.3
- laravel/framework: 5.5.*
- laravel/passport: ~4.0
- laravel/tinker: ~1.0
- mkinyua53/authorization: ^0.4.2
Requires (Dev)
- filp/whoops: ~2.0
- fzaninotto/faker: ~1.4
- mockery/mockery: ~1.0
- phpunit/phpunit: ~6.0
- symfony/thanks: ^1.0
README
Boilerplate for a PWA built with Laravel 5.5 and VueJs.
Includes a general /dashboard and an /admin dashboard
Install
Use Composer
composer create-project mkinyua53/laravel-vue-boilerplate myproject
cd myproject
npm run install
And then you can run watch to start on your vue project
npm run watch
Notable Packages
Backend
Frontend
Authorization
Please refer to the Authorization documentation for initial setup.
An InstallController is provided to quickly set-up your roles and permissions.
In the permissions() and roles() add your permissions and roles respectively to the array.
Go to the link /api/auth/install or call the installAuth() function from a route/controller to install the permissions and roles to the database. You can run as many times as you wish particullarly when you add new items in the arrays.
The resetAuth() function can be used to reset all roles and permissions to the default.
Vue Authorization
In Vue components, there a several methods to check authority. They return boolean value
Method | Accepts | Description |
---|---|---|
this.$auth.hasPermission(variable) | string | Checks if a user has a certain permission |
this.$auth.hasPermissions(variable) | array | Checks if a user has all the given permissions |
this.$auth.hasAnyPermissions(variable) | array | Checks if a user has any of the permissions |
this.$auth.hasRole(variable) | string | Checks if a user has a certain role |
this.$auth.hasRoles(variable) | array | Checks if a user has all the given roles |
this.$auth.hasAnyRoles(variable) | array | Checks if a user has any of the role |
Credit
Find me on twitter