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