Skip to content

Instantly share code, notes, and snippets.

View eliran-arkabi's full-sized avatar

Eliran Arkabi eliran-arkabi

View GitHub Profile
/** Warning if use this trait on class has be use magic methods __call | __classStatic dont use it
** Just copy the code to your magic methods on the class
* To fire the call need to and end Try
* example if you class Foo::test() to fire need to call Foo::testTryCatch()
* example if you class $ob->test() to fire need to call $ob->testTryCatch()
*/
trait TryCatchTrait{
public function __call($method, $arguments)
<?php
/** Warning if use this trait on class has be use magic methods __call | __classStatic dont use it
** Just copy the code to your magic methods on the class
* To fire the call need to and end TryCatch
* example if you class Foo::test() to fire need to call Foo::testTry()
* example if you class $ob->test() to fire need to call $ob->testTry()
*/
trait TryCatchTrait{
Return-Path: <remove>
Received: from mail-oi0-f47.google.com (mail-oi0-f47.google.com [209.85.218.47])
by inbound-smtp.us-east-1.amazonaws.com with SMTP id 14b8pniav4ee0v3tf9nkd734l541383ndqjja2o1
for remove;
Wed, 15 Aug 2018 15:02:29 +0000 (UTC)
X-SES-Spam-Verdict: PASS
X-SES-Virus-Verdict: PASS
Received-SPF: none (spfCheck: 209.85.218.47 is neither permitted nor denied by domain of remove) client-ip=209.85.218.47; envelope-from=remove; helo=mail-oi0-f47.google.com;
Authentication-Results: amazonses.com;
Return-Path: <[email protected]>
Received: from mail-oi0-f47.google.com (mail-oi0-f47.google.com [209.85.218.47])
by inbound-smtp.us-east-1.amazonaws.com with SMTP id 14b8pniav4ee0v3tf9nkd734l541383ndqjja2o1
for [email protected];
Wed, 15 Aug 2018 15:02:29 +0000 (UTC)
X-SES-Spam-Verdict: PASS
X-SES-Virus-Verdict: PASS
Received-SPF: none (spfCheck: 209.85.218.47 is neither permitted nor denied by domain of 3dsellers.com) client-ip=209.85.218.47; [email protected]; helo=mail-oi0-f47.google.com;
Authentication-Results: amazonses.com;
export const state = () => ({
someting: {}
})
export const getters = {
someting (state){
return state.someting
export default ({ route, store, redirect }) => {
const permissions = [].concat(...route.matched.map((r) => {
return (r.components.default.options ?
r.components.default.options.permissions :
r.components.default.permissions )
}))
@eliran-arkabi
eliran-arkabi / nuxtjs-permissions-roles-plugin.js
Last active September 4, 2021 04:59
nuxtjs plugin check permissions
import Vue from 'vue'
export default ({store, $axios}) => {
//add directives
//v-can - check permissions
Vue.directive('can', {
inserted (el, binding, vnode) {