belongsToMany(Game::class, 'languages_games'); } public static function findByCode($code) { return self::where('code', $code)->first(); } public static function findByTitle($title) { $term = mb_strtolower($title); return self::whereRaw('LOWER(title_en) = ?', $term) ->orWhereRaw('LOWER(title_ru) = ?',$term) ->first(); } }