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