public function store()
 {
     if (Auth::hasPermission('create')) {
         $key = Str::random($length = 30);
         $secret = Str::random($length = 60);
         $name = Input::get('name');
         $input = ["name" => $name, "key" => $key, "secret" => $secret];
         if ($this->validator->validate($input)) {
             $app = $this->application->create($name, $key, $secret);
             // return Response::json(['status'=>200,'key'=>$app->key,'secret'=>$app->secret]);
         }
     }
 }
Example #2
0
 public function destroy($id)
 {
     if (Auth::hasPermission('delete')) {
         $this->roles->remove($id);
     }
 }
Example #3
0
 function has_permission($permission)
 {
     return Auth::hasPermission($permission);
 }