Skip to content

Commit

Permalink
⏪ revert experimental station search (#3056)
Browse files Browse the repository at this point in the history
reverts 7b1361b

closes #3054
closes #3047

----------------

In 7b1361b we've tried to implement a local search, but as we don't continue to develop on this, I revert this feature for this time, as the user experience on this is not good.
  • Loading branch information
MrKrisKrisu authored Dec 26, 2024
1 parent f692a70 commit a18f207
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/Repositories/StationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,24 @@

namespace App\Repositories;

use App\DataProviders\Hafas;
use App\Http\Controllers\TransportController as TransportBackend;
use App\Models\Station;
use Illuminate\Support\Collection;

class StationRepository
{
public function getStationByName(string $name, string $lang, bool $invertLanguage = false): Collection {
$provider = new TransportBackend(Hafas::class);
return $provider->getTrainStationAutocomplete($name);

/*
* -------------------------------------
* This function was experimental and doesn't work as expected.
* It have no good user experience and should be improved before reusing.
* -------------------------------------
*/

$invertLanguage = $invertLanguage ? '!=' : '=';
return Station::leftJoin('station_names', 'station_names.station_id', '=', 'train_stations.id')
->where('station_names.name', 'LIKE', "$name")
Expand Down

0 comments on commit a18f207

Please sign in to comment.