public static function permissions($type = null, $data = null) { if ($type and $data) { return Permission::where($type, $data)->get(); } return Permission::all(); }