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