Example #1
0
 public function registerMarkupTags()
 {
     return ['functions' => ['can' => function ($can) {
         return UserGroup::can($can);
     }, 'hasRole' => function ($can) {
         return UserGroup::hasRole($can);
     }]];
 }
Example #2
0
 public function onRun()
 {
     $userPermision = $this->property('permission');
     if ($userPermision) {
         if (!UserGroup::can($userPermision)) {
             return;
         }
     }
     $person = user::find(intval($this->property('SLSlug')));
     if ($person) {
         $filename = $person->surname . '_' . $person->name . '.vcf';
         return response($this->renderPartial('@vcard', ['person' => $person]))->header('Content-Type', 'text/directory')->header('Content-Disposition', 'attachment; filename=' . $filename)->header('Pragma', 'public');
     }
 }