From ec1702b42dfb27507b168467a7b65c1b71e8a765 Mon Sep 17 00:00:00 2001 From: Brandon Date: Fri, 19 Jul 2024 10:29:42 -0500 Subject: [PATCH 01/13] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20event=20stub=20retur?= =?UTF-8?q?n=20type=20(#109)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Console/Commands/stubs/event.stub | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Console/Commands/stubs/event.stub b/src/Console/Commands/stubs/event.stub index 7d11bf9..0f03934 100644 --- a/src/Console/Commands/stubs/event.stub +++ b/src/Console/Commands/stubs/event.stub @@ -17,7 +17,7 @@ class {{ class }} extends Event /** * Handle the event. */ - public function handle({{ attributes }}): mixed + public function handle({{ attributes }}) { $this->console()->log('The {{ eventName }} event has fired!'); } From a3a1a0c95f2e23413f6bdd6be052b70e0ba83cc5 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sun, 21 Jul 2024 11:53:46 -0500 Subject: [PATCH 02/13] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Suppo?= =?UTF-8?q?rt=20over=205=20buttons=20in=20messages=20(#110)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Discord/Message.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/Discord/Message.php b/src/Discord/Message.php index 899235c..847733f 100644 --- a/src/Discord/Message.php +++ b/src/Discord/Message.php @@ -214,7 +214,9 @@ public function build(): MessageBuilder } if ($this->hasButtons()) { - $message->addComponent($this->getButtons()); + foreach ($this->getButtons() as $button) { + $message->addComponent($button); + } } if ($this->hasFiles()) { @@ -407,21 +409,23 @@ public function getComponents(): array } /** - * Get the buttons. + * Get the button components. */ - public function getButtons() + public function getButtons(): array { if (! $this->hasButtons()) { - return; + return []; } - $buttons = ActionRow::new(); + return collect($this->buttons)->chunk(5)->map(function ($buttons) { + $row = ActionRow::new(); - foreach ($this->buttons as $button) { - $buttons->addComponent($button); - } + foreach ($buttons as $button) { + $row->addComponent($button); + } - return $buttons; + return $row; + })->all(); } /** From 3388c24d602c2f234f0ba7981f636878fccfa313 Mon Sep 17 00:00:00 2001 From: Marek Szymczuk Date: Sat, 27 Jul 2024 17:02:04 +0200 Subject: [PATCH 03/13] =?UTF-8?q?=F0=9F=A9=B9=20Add=20missing=20import=20(?= =?UTF-8?q?#111)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Commands/ApplicationCommand.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Commands/ApplicationCommand.php b/src/Commands/ApplicationCommand.php index ca50709..e0f27ca 100644 --- a/src/Commands/ApplicationCommand.php +++ b/src/Commands/ApplicationCommand.php @@ -2,6 +2,8 @@ namespace Laracord\Commands; +use Discord\Parts\Permissions\RolePermission; + abstract class ApplicationCommand extends AbstractCommand { /** From 6bab8334bc5f7a1abfdbe489a4bd3495e5a2a112 Mon Sep 17 00:00:00 2001 From: Marek Szymczuk Date: Mon, 29 Jul 2024 00:41:52 +0200 Subject: [PATCH 04/13] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20token=20authorizatio?= =?UTF-8?q?n=20(#112)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Http/Middleware/AuthorizeToken.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Http/Middleware/AuthorizeToken.php b/src/Http/Middleware/AuthorizeToken.php index 4c787a3..be570aa 100644 --- a/src/Http/Middleware/AuthorizeToken.php +++ b/src/Http/Middleware/AuthorizeToken.php @@ -15,7 +15,7 @@ class AuthorizeToken */ public function handle(Request $request, Closure $next) { - $token = $request->bearerToken() ?? $request->query('token'); + $token = $request->bearerToken() ?? $request->input('token'); if (! $token) { return response()->json(['message' => 'You must specify a token.'], 401); From 8915b11b54b7d4988d07025242edb6cd90a73d3f Mon Sep 17 00:00:00 2001 From: Marek Szymczuk Date: Sat, 3 Aug 2024 05:38:14 +0200 Subject: [PATCH 05/13] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20token=20authorizatio?= =?UTF-8?q?n=20(#113)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Http/Middleware/AuthorizeToken.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Http/Middleware/AuthorizeToken.php b/src/Http/Middleware/AuthorizeToken.php index be570aa..5faf016 100644 --- a/src/Http/Middleware/AuthorizeToken.php +++ b/src/Http/Middleware/AuthorizeToken.php @@ -15,7 +15,7 @@ class AuthorizeToken */ public function handle(Request $request, Closure $next) { - $token = $request->bearerToken() ?? $request->input('token'); + $token = $request->bearerToken() ?? $request->get('token'); if (! $token) { return response()->json(['message' => 'You must specify a token.'], 401); From 152a1f8606abcab55a0de85cb77828ed51dc8304 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sat, 3 Aug 2024 12:05:37 -0500 Subject: [PATCH 06/13] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20missing=20`Exception?= =?UTF-8?q?`=20namespace=20on=20the=20`ResolvesUser`=20trait=20(#114)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Console/Concerns/ResolvesUser.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Console/Concerns/ResolvesUser.php b/src/Console/Concerns/ResolvesUser.php index 6be2f55..0f2d218 100644 --- a/src/Console/Concerns/ResolvesUser.php +++ b/src/Console/Concerns/ResolvesUser.php @@ -2,6 +2,7 @@ namespace Laracord\Console\Concerns; +use Exception; use Illuminate\Support\Facades\Http; use Illuminate\Support\Str; From 6db7353e7d62e0ae400916f5da101047250d4151 Mon Sep 17 00:00:00 2001 From: Marek Szymczuk Date: Sun, 4 Aug 2024 18:47:36 +0200 Subject: [PATCH 07/13] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20bad=20method=20call?= =?UTF-8?q?=20exception=20in=20the=20`Server`=20class=20(#115)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Http/Server.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Http/Server.php b/src/Http/Server.php index d45c5db..d451493 100644 --- a/src/Http/Server.php +++ b/src/Http/Server.php @@ -13,6 +13,7 @@ use React\Http\HttpServer; use React\Http\Message\Response; use React\Socket\SocketServer; +use Symfony\Component\HttpFoundation\BinaryFileResponse; use Throwable; class Server @@ -141,7 +142,7 @@ public function getServer() return new Response( $response->getStatusCode(), $response->headers->allPreserveCase(), - $response->getContent() ?: $response->getFile()?->getContent() ?: '' + $response->getContent() ?: ($response instanceof BinaryFileResponse ? $response->getFile()->getContent() : false) ?: '' ); }); } From eb9b5191cf303b498a913544b5c9b71732a0b273 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sun, 11 Aug 2024 16:21:37 -0500 Subject: [PATCH 08/13] =?UTF-8?q?=E2=AC=86=20Bump=20Discord=20PHP=20to=20v?= =?UTF-8?q?10.0.0-RC8=20(#117)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 18f5390..bd6f05a 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "react/async": "^4.2", "react/http": "^1.9", "symfony/psr-http-message-bridge": "^7.0", - "team-reflex/discord-php": "v10.0.0-RC7" + "team-reflex/discord-php": "v10.0.0-RC8" }, "require-dev": { "laravel/pint": "^1.15" From 259e3190b5dc4bf4785d0bcc52b26af5cd1ccd07 Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 19 Aug 2024 22:37:18 -0500 Subject: [PATCH 09/13] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20empty=20filename=20o?= =?UTF-8?q?n=20`Message::filePath`=20(#118)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Discord/Message.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Discord/Message.php b/src/Discord/Message.php index 847733f..6753958 100644 --- a/src/Discord/Message.php +++ b/src/Discord/Message.php @@ -541,10 +541,8 @@ public function body(string $body = ''): self /** * Add a file from content to the message. */ - public function file(string $content = '', string $filename = ''): self + public function file(string $content = '', string $filename = 'file.txt'): self { - $filename = $filename ?? 'file.txt'; - $this->files[] = [ 'content' => $content, 'filename' => $filename, @@ -556,7 +554,7 @@ public function file(string $content = '', string $filename = ''): self /** * Add a file to the message. */ - public function filePath(string $path, string $filename = ''): self + public function filePath(string $path, ?string $filename = null): self { if (! file_exists($path)) { $this->bot->console()->error("File {$path} does not exist"); From bfebcf66896ed3705775383973e40a7f5980211a Mon Sep 17 00:00:00 2001 From: Brandon Date: Wed, 2 Oct 2024 20:04:50 -0500 Subject: [PATCH 10/13] =?UTF-8?q?=E2=AC=86=20Bump=20dependencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bd6f05a..6aedd02 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "react/async": "^4.2", "react/http": "^1.9", "symfony/psr-http-message-bridge": "^7.0", - "team-reflex/discord-php": "v10.0.0-RC8" + "team-reflex/discord-php": "v10.0.0-RC10" }, "require-dev": { "laravel/pint": "^1.15" From ef37f5475b0a1f3ca104d3fd4a8422d6a2a4a005 Mon Sep 17 00:00:00 2001 From: Brandon Date: Wed, 2 Oct 2024 20:05:43 -0500 Subject: [PATCH 11/13] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Add?= =?UTF-8?q?=20file=20and=20line=20number=20to=20the=20console=20error=20ou?= =?UTF-8?q?tput?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Laracord.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Laracord.php b/src/Laracord.php index bddd94d..75a8a02 100644 --- a/src/Laracord.php +++ b/src/Laracord.php @@ -1311,7 +1311,10 @@ public function handleSafe(string $name, callable $callback): mixed return $callback(); } catch (Throwable $e) { $this->console()->error("An error occurred in {$name}."); - $this->console()->outputComponents()->bulletList([$e->getMessage()]); + + $this->console()->outputComponents()->bulletList([ + sprintf('%s in %s:%d', $e->getMessage(), $e->getFile(), $e->getLine()), + ]); } return null; From 791ce8d12e27df419c6a8ad4d05e6394256d3424 Mon Sep 17 00:00:00 2001 From: Brandon Date: Wed, 2 Oct 2024 20:19:29 -0500 Subject: [PATCH 12/13] =?UTF-8?q?=E2=9C=A8=20Add=20attachment=20support=20?= =?UTF-8?q?to=20the=20message=20builder=20=E2=9C=A8=20Add=20sticker=20supp?= =?UTF-8?q?ort=20to=20the=20message=20builder=20=E2=9C=A8=20Add=20local=20?= =?UTF-8?q?storage=20and=20URL=20support=20to=20`Message::file`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Discord/Message.php | 112 +++++++++++++++++++++++++++++++++++----- 1 file changed, 99 insertions(+), 13 deletions(-) diff --git a/src/Discord/Message.php b/src/Discord/Message.php index 6753958..39c53cc 100644 --- a/src/Discord/Message.php +++ b/src/Discord/Message.php @@ -15,11 +15,14 @@ use Discord\Parts\Channel\Channel; use Discord\Parts\Channel\Message as ChannelMessage; use Discord\Parts\Channel\Webhook; +use Discord\Parts\Guild\Sticker; use Discord\Parts\Interactions\Interaction; use Discord\Parts\User\User; use Discord\Repository\Channel\WebhookRepository; use Exception; use Illuminate\Support\Carbon; +use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Storage; use Illuminate\Support\Str; use Laracord\Laracord; use React\Promise\ExtendedPromiseInterface; @@ -145,6 +148,16 @@ class Message */ protected array $files = []; + /** + * The message attachments. + */ + protected ?Collection $attachments = null; + + /** + * The message stickers. + */ + protected array $stickers = []; + /** * The message webhook. */ @@ -198,9 +211,10 @@ public function build(): MessageBuilder { $message = MessageBuilder::new() ->setUsername($this->username) - ->setAvatarUrl($this->avatarUrl) + ->setAvatarUrl($this->getAttachment($this->avatarUrl)) ->setTts($this->tts) ->setContent($this->body) + ->setStickers($this->stickers) ->setComponents($this->getComponents()); if ($this->hasContent() || $this->hasFields()) { @@ -383,18 +397,18 @@ public function getEmbed(): array 'color' => $this->color, 'footer' => [ 'text' => $this->footerText, - 'icon_url' => $this->footerIcon, + 'icon_url' => $this->getAttachment($this->footerIcon), ], 'thumbnail' => [ - 'url' => $this->thumbnailUrl, + 'url' => $this->getAttachment($this->thumbnailUrl), ], 'image' => [ - 'url' => $this->imageUrl, + 'url' => $this->getAttachment($this->imageUrl), ], 'author' => [ 'name' => $this->authorName, 'url' => $this->authorUrl, - 'icon_url' => $this->authorIcon, + 'icon_url' => $this->getAttachment($this->authorIcon), ], 'fields' => $this->fields, ])->filter()->all(); @@ -539,10 +553,30 @@ public function body(string $body = ''): self } /** - * Add a file from content to the message. + * Add a file using raw input, local storage, or a remote URL to the message. */ - public function file(string $content = '', string $filename = 'file.txt'): self + public function file(string $input = '', ?string $filename = null): self { + $isPath = (! $isUrl = Str::isUrl($input)) + && Str::length($input) <= 1024 + && ! Str::contains($input, [DIRECTORY_SEPARATOR, "\n"]) + && Str::isMatch('/\.\w+$/', $input); + + $isPath = $isPath && Storage::drive('local')->exists($input); + + $content = match (true) { + $isUrl => file_get_contents($input), + $isPath => Storage::drive('local')->get($input), + default => $input, + }; + + $filename = match (true) { + filled($filename) => $filename, + $isUrl => basename(parse_url($input, PHP_URL_PATH)), + $isPath => basename($input), + default => 'file.txt', + }; + $this->files[] = [ 'content' => $content, 'filename' => $filename, @@ -577,6 +611,28 @@ public function hasFiles(): bool return ! empty($this->files); } + /** + * Retrieve the message file attachments. + */ + protected function getAttachments(): Collection + { + return $this->attachments ??= collect($this->files)->mapWithKeys(fn ($file) => [ + $file['filename'] => "attachment://{$file['filename']}", + ]); + } + + /** + * Retrieve a message file attachment. + */ + protected function getAttachment(?string $filename = null): ?string + { + if (blank($filename)) { + return null; + } + + return $this->getAttachments()->get($filename, $filename); + } + /** * Set the message color. */ @@ -658,9 +714,7 @@ public function footerText(?string $footerText): self */ public function thumbnail(?string $thumbnailUrl): self { - $this->thumbnailUrl = $thumbnailUrl; - - return $this; + return $this->thumbnailUrl($thumbnailUrl); } /** @@ -688,9 +742,7 @@ public function url(?string $url): self */ public function image(?string $imageUrl): self { - $this->imageUrl = $imageUrl; - - return $this; + return $this->imageUrl($imageUrl); } /** @@ -703,6 +755,40 @@ public function imageUrl(?string $imageUrl): self return $this; } + /** + * Add a sticker to the message. + */ + public function sticker(string|Sticker $sticker): self + { + $this->stickers[] = $sticker instanceof Sticker + ? $sticker->id + : $sticker; + + return $this; + } + + /** + * Add stickers to the message. + */ + public function stickers(array $stickers): self + { + foreach ($stickers as $sticker) { + $this->sticker($sticker); + } + + return $this; + } + + /** + * Clear the stickers from the message. + */ + public function clearStickers(): self + { + $this->stickers = []; + + return $this; + } + /** * Set the message timestamp. */ From 44d84141a5cc9c0d653129ecfe939259ba17cb44 Mon Sep 17 00:00:00 2001 From: Brandon Date: Wed, 2 Oct 2024 20:23:33 -0500 Subject: [PATCH 13/13] =?UTF-8?q?=F0=9F=94=A7=20Update=20the=20default=20d?= =?UTF-8?q?atabase=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/database.php | 96 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 75 insertions(+), 21 deletions(-) diff --git a/config/database.php b/config/database.php index c4cc182..6893f2f 100644 --- a/config/database.php +++ b/config/database.php @@ -10,8 +10,9 @@ |-------------------------------------------------------------------------- | | Here you may specify which of the database connections below you wish - | to use as your default connection for all database work. Of course - | you may use many connections at once using the Database library. + | to use as your default connection for database operations. This is + | the connection which will be utilized unless another connection + | is explicitly specified when you execute a query / statement. | */ @@ -22,14 +23,9 @@ | Database Connections |-------------------------------------------------------------------------- | - | Here are each of the database connections setup for your application. - | Of course, examples of configuring each database platform that is - | supported by Laravel is shown below to make development simple. - | - | - | All database work in Laravel is done through the PHP PDO facilities - | so make sure you have the driver for your particular database of - | choice installed on your machine before you begin development. + | Below are all of the database connections defined for your application. + | An example configuration is provided for each database system which + | is supported by Laravel. You're free to add / remove connections. | */ @@ -37,26 +33,49 @@ 'sqlite' => [ 'driver' => 'sqlite', - 'url' => env('DATABASE_URL'), + 'url' => env('DB_URL'), 'database' => env('DB_DATABASE', config('app.env') === 'production' ? laracord_path('database.sqlite', basePath: false) : database_path('database.sqlite') ), 'prefix' => '', 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), + 'busy_timeout' => null, + 'journal_mode' => null, + 'synchronous' => null, ], 'mysql' => [ 'driver' => 'mysql', - 'url' => env('DATABASE_URL'), + 'url' => env('DB_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'laracord'), + 'username' => env('DB_USERNAME', 'root'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => env('DB_CHARSET', 'utf8mb4'), + 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), + 'prefix' => '', + 'prefix_indexes' => true, + 'strict' => true, + 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ + PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + ]) : [], + ], + + 'mariadb' => [ + 'driver' => 'mariadb', + 'url' => env('DB_URL'), 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'laracord'), - 'username' => env('DB_USERNAME', 'laracord'), + 'username' => env('DB_USERNAME', 'root'), 'password' => env('DB_PASSWORD', ''), 'unix_socket' => env('DB_SOCKET', ''), - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_unicode_ci', + 'charset' => env('DB_CHARSET', 'utf8mb4'), + 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), 'prefix' => '', 'prefix_indexes' => true, 'strict' => true, @@ -66,6 +85,36 @@ ]) : [], ], + 'pgsql' => [ + 'driver' => 'pgsql', + 'url' => env('DB_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '5432'), + 'database' => env('DB_DATABASE', 'laracord'), + 'username' => env('DB_USERNAME', 'root'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => env('DB_CHARSET', 'utf8'), + 'prefix' => '', + 'prefix_indexes' => true, + 'search_path' => 'public', + 'sslmode' => 'prefer', + ], + + 'sqlsrv' => [ + 'driver' => 'sqlsrv', + 'url' => env('DB_URL'), + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '1433'), + 'database' => env('DB_DATABASE', 'laracord'), + 'username' => env('DB_USERNAME', 'root'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => env('DB_CHARSET', 'utf8'), + 'prefix' => '', + 'prefix_indexes' => true, + // 'encrypt' => env('DB_ENCRYPT', 'yes'), + // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), + ], + ], /* @@ -75,11 +124,14 @@ | | This table keeps track of all the migrations that have already run for | your application. Using this information, we can determine which of - | the migrations on disk haven't actually been run in the database. + | the migrations on disk haven't actually been run on the database. | */ - 'migrations' => 'migrations', + 'migrations' => [ + 'table' => 'migrations', + 'update_date_on_publish' => true, + ], /* |-------------------------------------------------------------------------- @@ -88,7 +140,7 @@ | | Redis is an open source, fast, and advanced key-value store that also | provides a richer body of commands than a typical key-value system - | such as APC or Memcached. Laravel makes it easy to dig right in. + | such as Memcached. You may define your connection settings here. | */ @@ -98,13 +150,14 @@ 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laracord'), '_').'_database_'), ], 'default' => [ 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST', '127.0.0.1'), - 'password' => env('REDIS_PASSWORD', null), + 'username' => env('REDIS_USERNAME'), + 'password' => env('REDIS_PASSWORD'), 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_DB', '0'), ], @@ -112,7 +165,8 @@ 'cache' => [ 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST', '127.0.0.1'), - 'password' => env('REDIS_PASSWORD', null), + 'username' => env('REDIS_USERNAME'), + 'password' => env('REDIS_PASSWORD'), 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_CACHE_DB', '1'), ],