public static function blog($type, $data) { if ($type == 'id') { return Blog::findOrFail($data); } return Blog::where($type, $data)->first(); }