From db917bdc9229dfb0c36d5e22e2facac9f0f9e22a Mon Sep 17 00:00:00 2001 From: salam Date: Sun, 11 Oct 2026 15:42:00 +0200 Subject: [PATCH] centralized grapper tournaments wi --- app/Models/SofaScoreDayTournament.php | 4 + app/Models/SofaScoreEventGrapped.php | 2 + app/Traits/Sofascore/GrappingEvent.php | 302 +++++++++++-------- app/Traits/Sofascore/GrappingHelper.php | 56 ++-- app/Traits/Sofascore/GrappingSofascore.php | 55 +++- app/Traits/Sofascore/GrappingTournaments.php | 47 ++- backup.env | 84 ++++++ config/database.php | 2 +- 8 files changed, 379 insertions(+), 173 deletions(-) create mode 100644 backup.env diff --git a/app/Models/SofaScoreDayTournament.php b/app/Models/SofaScoreDayTournament.php index f30fc158..5c70bf6d 100644 --- a/app/Models/SofaScoreDayTournament.php +++ b/app/Models/SofaScoreDayTournament.php @@ -6,6 +6,10 @@ use Illuminate\Database\Eloquent\Model; class SofaScoreDayTournament extends Model { + protected $connection = 'mariadb'; + + protected $table = 'sofa_score_day_tournaments'; + protected $fillable = [ 'id', 'tournament_id', diff --git a/app/Models/SofaScoreEventGrapped.php b/app/Models/SofaScoreEventGrapped.php index adece5ec..6f46a949 100644 --- a/app/Models/SofaScoreEventGrapped.php +++ b/app/Models/SofaScoreEventGrapped.php @@ -11,6 +11,8 @@ class SofaScoreEventGrapped extends Model 'grapper_id', 'name', 'url', + 'day', + 'liga', 'starttime', 'got_statistics', 'got_lineups', diff --git a/app/Traits/Sofascore/GrappingEvent.php b/app/Traits/Sofascore/GrappingEvent.php index f61a86f2..dc4ddede 100644 --- a/app/Traits/Sofascore/GrappingEvent.php +++ b/app/Traits/Sofascore/GrappingEvent.php @@ -2,9 +2,7 @@ namespace App\Traits\Sofascore; -use App\Models\SofaScoreDayTournament; use App\Models\SofaScoreEventGrapped; -use App\Models\SofaScoreTaskDay; use App\Services\CloudflareSolverService; use App\Utilities\Notice; use Illuminate\Support\Carbon; @@ -14,150 +12,190 @@ trait GrappingEvent { protected function get_event(string $day, array $tournament) { - $res = SofaScoreDayTournament::whereDate('day', '=', $day)->where('tournament_id', $tournament['sofa_score_tournament_id'])->first(); + foreach ($this->day_tournaments as $day_tournament) { - if ($res) { + if ($day_tournament->tournament_id == $tournament['sofa_score_tournament_id']) { - if ($this->debug) { - Notice::note("$day - " . $tournament['tournament']['name'] . ' - ' . $tournament['sofa_score_tournament_id'], 'bb'); - } + if ($this->debug) { + Notice::note("$day - ".$tournament['tournament']['name'].' - '.$tournament['sofa_score_tournament_id'], 'bb'); + } - $url = $this->base_url . 'api/v1/unique-tournament/' . $tournament['sofa_score_tournament_id'] . "/scheduled-events/$day"; + $url = $this->base_url.'api/v1/unique-tournament/'.$tournament['sofa_score_tournament_id']."/scheduled-events/$day"; - if ($this->debug) { - Notice::note($url, 'p'); - } + if ($this->debug) { + Notice::note($url, 'p'); + } - $this->sleep(1); + $this->sleep(1); - $cloudflareService = new CloudflareSolverService; + $cloudflareService = new CloudflareSolverService; - $data = $cloudflareService->getJsonFromUrl($url); + $data = $cloudflareService->getJsonFromUrl($url); - if (isset($data['events'])) { + if (isset($data['events'])) { - foreach ($data['events'] as $event) { + foreach ($data['events'] as $event) { - if (! $this->restart && SofaScoreEventGrapped::where('grapper_id', $this->task_id)->where('id', (int) $event['id'])->exists()) { - if ($this->debug) { - Notice::note('DB - Allready grapped at ' . $day . ' - ' . $event['homeTeam']['name'] . ' vs ' . $event['awayTeam']['name'], 'b'); + $base_check_string = $day.'-'.$event['tournament']['category']['slug'].'-'.$event['tournament']['slug'].'/'.$event['slug']; + + $res = SofaScoreEventGrapped::where('id', (int) $event['id'])->where('grapper_id', $this->task_id)->first(); + + if (! $res) { + + $base_check_string = $day.'-'.$event['tournament']['category']['slug'].'-'.$event['tournament']['slug'].'/'.$event['slug']; + + // chinese-super-league + + if (! $this->restart && SofaScoreEventGrapped::where('grapper_id', $this->task_id)->where('id', (int) $event['id'])->exists()) { + if ($this->debug) { + Notice::note('DB - Allready grapped at '.$day.' - '.$event['homeTeam']['name'].' vs '.$event['awayTeam']['name'], 'b'); + } + } else { + + if ($this->debug) { + Notice::note("$day - ".$event['homeTeam']['name'].' vs '.$event['awayTeam']['name'], 'g'); + } + + $folder = strtolower("$this->data_dir/$day/$day-".$event['tournament']['category']['slug'].'-'.$event['tournament']['slug'].'/'.$event['slug']); + + File::makeDirectory($folder, 0775, true, true); + + /********************************* + * EVENT event + *********************************/ + + File::put("$folder/event.json", json_encode($event)); + + /********************************* + * EVENT statistics + *********************************/ + + $event_id = $event['id']; + + if (! $this->grapped($base_check_string.'/statistics.json')) { + + $url = $this->base_url."api/v1/event/$event_id/statistics"; + + if ($this->debug) { + Notice::note($url, 'b'); + } + + $this->sleep(); + + $data = $cloudflareService->getJsonFromUrl($url); + + $data['id'] = $event_id; + + File::put("$folder/statistics.json", json_encode($data)); + + } else { + if ($this->debug) { + Notice::note('already grapped statistics.json', 'y'); + } + } + + /********************************* + * EVENT lineups + *********************************/ + + if (! $this->grapped($base_check_string.'/lineups.json')) { + + $url = $this->base_url."api/v1/event/$event_id/lineups"; + + if ($this->debug) { + Notice::note($url, 'b'); + } + + $this->sleep(); + + $data = $cloudflareService->getJsonFromUrl($url); + + $data['id'] = $event_id; + + File::put("$folder/lineups.json", json_encode($data)); + + } else { + if ($this->debug) { + Notice::note('already grapped lineups.json', 'y'); + } + } + + /********************************* + * EVENT odds + *********************************/ + + if (! $this->grapped($base_check_string.'/odds.json')) { + + $url = $this->base_url."api/v1/event/$event_id/odds/1/all"; + + if ($this->debug) { + Notice::note($url, 'b'); + } + + $this->sleep(); + + $data = $cloudflareService->getJsonFromUrl($url); + + $data['id'] = $event_id; + + File::put("$folder/odds.json", json_encode($data)); + } else { + if ($this->debug) { + Notice::note('already grapped odds.json', 'y'); + } + } + /********************************* + * EVENT incidents + *********************************/ + + if (! $this->grapped($base_check_string.'/incidents.json')) { + + $url = $this->base_url."api/v1/event/$event_id/incidents"; + + if ($this->debug) { + Notice::note($url, 'b'); + } + + $this->sleep(); + + $data = $cloudflareService->getJsonFromUrl($url); + + $data['id'] = $event_id; + + File::put("$folder/incidents.json", json_encode($data)); + + } else { + if ($this->debug) { + Notice::note('already grapped incidents.json', 'y'); + } + } + + $starttime = Carbon::createFromTimestamp($event['startTimestamp']); + + SofaScoreEventGrapped::updateOrCreate([ + 'id' => (int) $event['id'], + ], [ + 'grapper_id' => $this->task_id, + 'day' => $day, + 'liga' => $event['tournament']['name'], + 'name' => $event['homeTeam']['name'].' vs '.$event['awayTeam']['name'], + 'url' => $url, + 'starttime' => $starttime->toDateTimeString(), + ]); + } + } else { + if ($this->debug) { + Notice::note('grapped: '.$base_check_string, 'p'); + } } - } else { - - if ($this->debug) { - Notice::note("$day - " . $event['homeTeam']['name'] . ' vs ' . $event['awayTeam']['name'], 'g'); - } - - $folder = strtolower("$this->data_dir/$day/$day-" . $event['tournament']['category']['slug'] . '-' . $event['tournament']['slug'] . '/' . $event['slug']); - - File::makeDirectory($folder, 0775, true, true); - - /********************************* - * EVENT event - *********************************/ - - File::put("$folder/event.json", json_encode($event)); - - /********************************* - * EVENT statistics - *********************************/ - - $event_id = $event['id']; - - $url = $this->base_url . "api/v1/event/$event_id/statistics"; - - if ($this->debug) { - Notice::note($url, 'b'); - } - - $this->sleep(); - - $data = $cloudflareService->getJsonFromUrl($url); - - $data['id'] = $event_id; - - File::put("$folder/statistics.json", json_encode($data)); - - /********************************* - * EVENT lineups - *********************************/ - - $url = $this->base_url . "api/v1/event/$event_id/lineups"; - - if ($this->debug) { - Notice::note($url, 'b'); - } - - $this->sleep(); - - $data = $cloudflareService->getJsonFromUrl($url); - - $data['id'] = $event_id; - - File::put("$folder/lineups.json", json_encode($data)); - - /********************************* - * EVENT odds - *********************************/ - - $url = $this->base_url . "api/v1/event/$event_id/odds/1/all"; - - if ($this->debug) { - Notice::note($url, 'b'); - } - - $this->sleep(); - - $data = $cloudflareService->getJsonFromUrl($url); - - $data['id'] = $event_id; - - File::put("$folder/odds.json", json_encode($data)); - - /********************************* - * EVENT incidents - *********************************/ - - $url = $this->base_url . "api/v1/event/$event_id/incidents"; - - if ($this->debug) { - Notice::note($url, 'b'); - } - - $this->sleep(); - - $data = $cloudflareService->getJsonFromUrl($url); - - $data['id'] = $event_id; - - File::put("$folder/incidents.json", json_encode($data)); - - $starttime = Carbon::createFromTimestamp($event['startTimestamp']); - - SofaScoreEventGrapped::updateOrCreate([ - 'id' => (int) $event['id'], - ], [ - 'grapper_id' => $this->task_id, - 'day' => $day, - 'liga' => $event['tournament']['name'], - 'name' => $event['homeTeam']['name'] . ' vs ' . $event['awayTeam']['name'], - 'url' => $url, - 'starttime' => $starttime->toDateTimeString(), - ]); } } - } - } else { - if ($this->debug) { - Notice::note($day . ' - ' . $tournament['tournament']['name'] . " no events", 'y'); + + return; } } - - SofaScoreTaskDay::updateOrCreate([ - 'grapper_id' => (int) $this->task_id, - 'day' => $day, - ], [ - 'done' => 1, - ]); + if ($this->debug) { + Notice::note($day.' - '.$tournament['tournament']['name'].' no events', 'y'); + } } } diff --git a/app/Traits/Sofascore/GrappingHelper.php b/app/Traits/Sofascore/GrappingHelper.php index 576ff861..0b2be4df 100644 --- a/app/Traits/Sofascore/GrappingHelper.php +++ b/app/Traits/Sofascore/GrappingHelper.php @@ -2,17 +2,12 @@ namespace App\Traits\Sofascore; -use App\Models\Country; -use App\Models\SofaScoreCategory; -use App\Models\SofaScoreDayTournament; -use App\Models\SofaScoreEventGrapped; use App\Models\SofaScoreRosa; use App\Models\SofaScoreTask; use App\Models\SofaScoreTaskDay; use App\Models\SofaScoreTaskTournament; use App\Models\SofaScoreTournament; use App\Models\StatistikoImport; -use App\Services\CloudflareSolverService; use App\Utilities\Notice; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\DB; @@ -97,16 +92,16 @@ trait GrappingHelper { switch ($grapperSelected) { case 'daily': - $this->data_dir = storage_path($this->base_dir) . '/daily'; + $this->data_dir = storage_path($this->base_dir).'/daily'; break; case 'range': - $this->data_dir = storage_path($this->base_dir) . '/range'; + $this->data_dir = storage_path($this->base_dir).'/range'; break; case 'rose': - $this->data_dir = storage_path($this->base_dir) . '/rose'; + $this->data_dir = storage_path($this->base_dir).'/rose'; break; case 'player': - $this->data_dir = storage_path($this->base_dir) . '/player'; + $this->data_dir = storage_path($this->base_dir).'/player'; break; case 'excel': case 'mail': @@ -125,6 +120,12 @@ trait GrappingHelper */ protected function load_tournaments_requested(string $grapperSelected) { + /** + * SofaScoreDayTournament + */ + if ($this->debug) { + Notice::note('get tournaments for grapper', 'g'); + } switch ($grapperSelected) { case 'daily': $this->tournaments_requested = SofaScoreTaskTournament::with('tournament')->where('sofa_score_task_id', 1)->where('disabled', false)->get()->toArray(); @@ -217,20 +218,33 @@ trait GrappingHelper protected function get_tree(string $dir, &$results = []) { - $files = scandir($dir); - foreach ($files as $value) { - $path = realpath($dir . DIRECTORY_SEPARATOR . $value); - if (! is_dir($path)) { - $results[] = $path; - } elseif ($value != '.' && $value != '..') { - self::get_tree($path, $results); - $results[] = $path; + if (File::isDirectory($dir)) { + $files = scandir($dir); + foreach ($files as $value) { + $path = realpath($dir.DIRECTORY_SEPARATOR.$value); + if (! is_dir($path)) { + $results[] = $path; + } elseif ($value != '.' && $value != '..') { + self::get_tree($path, $results); + $results[] = $path; + } } } return $results; } + protected function grapped(string $string) + { + foreach ($this->grapped_files as $file) { + if (strpos($file, $string) !== false) { + return true; + } + } + + return false; + } + protected function clean_string(string $string) { $string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens. @@ -242,7 +256,7 @@ trait GrappingHelper protected function clear_folder(string $folder, $what = '') { - $mainFolder = storage_path($this->base_dir . '/' . $folder); + $mainFolder = storage_path($this->base_dir.'/'.$folder); if (! $what) { $what = $this->select_what_delete(); @@ -273,8 +287,8 @@ trait GrappingHelper $tasks = StatistikoImport::pluck('file_name')->toArray(); collect(Storage::disk('public')->allFiles('statistiko')) - ->reject(fn(string $file) => $file === '.gitignore') - ->reject(fn(string $file) => in_array($file, $tasks)) - ->each(fn($file) => Storage::disk('public')->delete($file)); + ->reject(fn (string $file) => $file === '.gitignore') + ->reject(fn (string $file) => in_array($file, $tasks)) + ->each(fn ($file) => Storage::disk('public')->delete($file)); } } diff --git a/app/Traits/Sofascore/GrappingSofascore.php b/app/Traits/Sofascore/GrappingSofascore.php index fedbc6b0..9c2da614 100644 --- a/app/Traits/Sofascore/GrappingSofascore.php +++ b/app/Traits/Sofascore/GrappingSofascore.php @@ -3,8 +3,11 @@ namespace App\Traits\Sofascore; use App\Mail\SimpleMail; +use App\Models\SofaScoreEventGrapped; +use App\Models\SofaScoreTaskDay; use App\Utilities\Notice; use Illuminate\Support\Carbon; +use Illuminate\Support\Collection; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Mail; @@ -37,6 +40,10 @@ trait GrappingSofascore protected array $tournaments_requested = []; + protected array $grapped_files = []; + + protected Collection $day_tournaments; + protected array $days = []; public function handle(): void @@ -116,8 +123,6 @@ trait GrappingSofascore $this->task_id = 1; - $this->restart = 1; - $this->set_base_dir($folder); $this->load_tournaments_requested($folder); @@ -126,9 +131,14 @@ trait GrappingSofascore switch ($restart) { case 'restart': $this->restart = 1; + + SofaScoreEventGrapped::truncate(); break; case 'clear': $this->restart = 1; + + SofaScoreEventGrapped::truncate(); + $this->clear_folder($folder, 'all'); break; } @@ -136,37 +146,47 @@ trait GrappingSofascore /** * day 1 */ - $day = Carbon::now()->subDay()->format('Y-m-d'); - $this->grap_tournaments_for_day($day); + $res = SofaScoreTaskDay::where('grapper_id', (int) $this->task_id)->where('day', $day)->first(); - foreach ($this->tournaments_requested as $tournament) { - $this->get_event($day, $tournament); + if (! $res) { + $this->grapped_files = $this->get_tree($this->data_dir.'/'.$day); + + $this->grap_tournaments_for_day($day); + + foreach ($this->tournaments_requested as $tournament) { + $this->get_event($day, $tournament); + } + SofaScoreTaskDay::updateOrCreate(['grapper_id' => (int) $this->task_id, 'day' => $day], ['done' => 1]); } - /** * day 5 */ - $day = Carbon::now()->subDays(5)->format('Y-m-d'); - $this->grap_tournaments_for_day($day); + $res = SofaScoreTaskDay::where('grapper_id', (int) $this->task_id)->where('day', $day)->first(); - foreach ($this->tournaments_requested as $tournament) { - $this->get_event($day, $tournament); + if (! $res) { + + $this->grapped_files = $this->get_tree($this->data_dir.'/'.$day); + + $this->grap_tournaments_for_day($day); + + foreach ($this->tournaments_requested as $tournament) { + $this->get_event($day, $tournament); + } + + SofaScoreTaskDay::updateOrCreate(['grapper_id' => (int) $this->task_id, 'day' => $day], ['done' => 1]); } - /** * to excel day by day */ - $this->import_to_excel($folder); /** * mail it */ - $this->send($folder); } @@ -188,6 +208,8 @@ trait GrappingSofascore foreach ($this->tournaments_requested as $tournament) { $this->get_event($day, $tournament); } + + SofaScoreTaskDay::updateOrCreate(['grapper_id' => (int) $this->task_id, 'day' => $day], ['done' => 1]); } if ($this->debug) { @@ -243,6 +265,8 @@ trait GrappingSofascore foreach ($this->tournaments_requested as $tournament) { $this->get_event($day, $tournament); } + + SofaScoreTaskDay::updateOrCreate(['grapper_id' => (int) $this->task_id, 'day' => $day], ['done' => 1]); } } @@ -258,8 +282,9 @@ trait GrappingSofascore $directories = File::directories($this->data_dir); $arr = []; foreach ($directories as $directory) { - $arr[] = substr(strrchr($directory, "/"), 1); + $arr[] = substr(strrchr($directory, '/'), 1); } + return $arr; } diff --git a/app/Traits/Sofascore/GrappingTournaments.php b/app/Traits/Sofascore/GrappingTournaments.php index 4277e8be..5452fc06 100644 --- a/app/Traits/Sofascore/GrappingTournaments.php +++ b/app/Traits/Sofascore/GrappingTournaments.php @@ -20,25 +20,52 @@ trait GrappingTournaments { $sport_id = 1; - $has = SofaScoreDayTournament::where('day', $day)->first(); + if ($this->debug) { + Notice::note('⚽ tournaments for day '.$day); + Notice::note('⚽ close all vpn'); + } + exec('killall ssh'); - $slug = 'football'; + if ($this->debug) { + Notice::note('⚽ open vpn'); + } + exec('ssh -f -N -L 13306:127.0.0.1:3306 -p 58371 root@162.55.242.190'); + /** + * SofaScoreDayTournament + */ + if ($this->debug) { + Notice::note('get tournaments', 'g'); + } - if (! $this->force && $has) { + $this->day_tournaments = SofaScoreDayTournament::where('day', $day)->get(); + + if (! $this->restart && $this->day_tournaments->count() > 0) { if ($this->debug) { Notice::note("$day Tournaments allready grapped", 'bb'); } + + if ($this->debug) { + Notice::note('⚽ close all vpn'); + } + exec('killall ssh'); + + return; } else { $page = 1; $tournaments_counter = 0; + $slug = 'football'; while ($page) { // $data = $this->curl($url); + if ($this->debug) { + Notice::note('⚽ close all vpn and load tournaments'); + } + $this->sleep(); - $url = $this->base_url . "api/v1/sport/$slug/scheduled-tournaments/$day/page/$page"; + $url = $this->base_url."api/v1/sport/$slug/scheduled-tournaments/$day/page/$page"; $cloudflareService = new CloudflareSolverService; @@ -158,6 +185,18 @@ trait GrappingTournaments if ($this->debug) { Notice::note("$day Tournaments loaded", 'bb'); } + + if ($this->debug) { + Notice::note('⚽ close all vpn'); + } + + $this->day_tournaments = SofaScoreDayTournament::where('day', $day)->get(); + + if ($this->debug) { + Notice::note('⚽ close all vpn'); + } + + exec('killall ssh'); } } } diff --git a/backup.env b/backup.env new file mode 100644 index 00000000..594d5059 --- /dev/null +++ b/backup.env @@ -0,0 +1,84 @@ +APP_NAME=Odds +APP_ENV=local +APP_KEY=base64:xhigDJOEk2dBUc3pfYXm7yo8a14PTtVCIU4PAt+F2dM= +APP_DEBUG=1 +APP_URL=https://nuhodds_fi4.test + +# BETSAPI_TOKEN="36152-aeTRNnZxSPUwGe" +# TXODDS_TOKEN_SOCCER="ident=betaid1&passwd=Dy59vpRC" +# TXODDS_TOKEN_OTHER="ident=betaid2&passwd=Dy59vpRC" +# LOGIFUTURE_TOKEN="uSwIqs!Y3eHrNbyH" + +# Da Laravel lokal (via Brew) läuft, greift es über localhost auf Docker zu +FLARESOLVERR_URL=http://192.168.145 +FLARESOLVERR_IP_DOCKER=http://localhost:8191/v1 + +APP_LOCALE=en +APP_FALLBACK_LOCALE=en +APP_FAKER_LOCALE=en_US + +APP_MAINTENANCE_DRIVER=file +# APP_MAINTENANCE_STORE=database + +PHP_CLI_SERVER_WORKERS=4 + +BCRYPT_ROUNDS=12 + +LOG_CHANNEL=stack +LOG_STACK=single +LOG_DEPRECATIONS_CHANNEL=null +LOG_LEVEL=debug +APP_TIMEZONE=Europe/Vienna + +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=nuhodds_fi4 +DB_USERNAME=root +DB_PASSWORD=salam + +DB_REMOTE_HOST=162.55.242.190 +DB_REMOTE_PORT=3306 +DB_REMOTE_DATABASE=day_tournament +DB_REMOTE_USERNAME=root +DB_REMOTE_PASSWORD=salam + +MONGODB_URI="mongodb://localhost:27017/" +MONGO_DATABASE=nuhodds + +SESSION_DRIVER=file +SESSION_LIFETIME=120 +SESSION_ENCRYPT=false +SESSION_PATH=/ +SESSION_DOMAIN=null + +BROADCAST_CONNECTION=log +FILESYSTEM_DISK=local +QUEUE_CONNECTION=sync + +CACHE_STORE=database +# CACHE_PREFIX= + +MEMCACHED_HOST=127.0.0.1 + +REDIS_CLIENT=phpredis +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_MAILER=smtp +MAIL_HOST=mail.your-server.de +MAIL_PORT=587 +MAIL_USERNAME=hermann.telser@nuhodds.com +MAIL_PASSWORD=6j7c3RI9moCPt33h +MAIL_ENCRYPTION=tls +MAIL_FROM_ADDRESS=hermann.telser@nuhodds.com +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= +AWS_USE_PATH_STYLE_ENDPOINT=false + +VITE_APP_NAME="${APP_NAME}" diff --git a/config/database.php b/config/database.php index 0d756a88..d2a47e86 100644 --- a/config/database.php +++ b/config/database.php @@ -138,7 +138,7 @@ return [ 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')) . '-database-'), + 'prefix' => env('REDIS_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')).'-database-'), 'persistent' => env('REDIS_PERSISTENT', false), ],