hasMany(UaderMapucheFamiliares::class, 'id_uader_mapu_pers', 'id'); } static public function BuscarPersonaPorTelefono($cel) { $persona = DB::table('uader_mapuche_persona') ->selectRaw('max(id) as id_dj') ->whereRaw("'549'||REGEXP_REPLACE(telefono_celular, '-|-15','','g') = '$cel'") ->first(); if (!empty($persona)) { return UaderMapuchePersona::find($persona->id_dj); } else { return 0; } } }