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]); } } }
public function destroy($id) { if (Auth::hasPermission('delete')) { $this->roles->remove($id); } }
function has_permission($permission) { return Auth::hasPermission($permission); }