From: Daniel Karbach Date: Wed, 14 Jun 2023 09:26:59 +0000 (+0200) Subject: discord discriminator stuff round 2 X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=b98dac4d596e4bed9a5f96526aa66ea8512ad2ab;p=alttp.git discord discriminator stuff round 2 --- diff --git a/app/Http/Controllers/DiscordController.php b/app/Http/Controllers/DiscordController.php index 6f9c03d..1625e32 100644 --- a/app/Http/Controllers/DiscordController.php +++ b/app/Http/Controllers/DiscordController.php @@ -146,6 +146,7 @@ class DiscordController extends \Jakyeru\Larascord\Http\Controllers\DiscordContr ], [ 'username' => $user->username, + 'discord_nickname' => isset($user->global_name) ? $user->global_name : NULL, 'discriminator' => $user->discriminator, 'email' => isset($user->email) ? $user->email : NULL, 'avatar' => $user->avatar ?: NULL, diff --git a/app/Models/User.php b/app/Models/User.php index ad5215f..72286a4 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -190,6 +190,7 @@ class User extends Authenticatable protected $fillable = [ 'id', 'username', + 'discord_nickname', 'discriminator', 'email', 'avatar', diff --git a/database/migrations/2023_06_14_091826_add_user_discord_nickname.php b/database/migrations/2023_06_14_091826_add_user_discord_nickname.php new file mode 100644 index 0000000..a8e9a35 --- /dev/null +++ b/database/migrations/2023_06_14_091826_add_user_discord_nickname.php @@ -0,0 +1,32 @@ +string('discord_nickname')->nullable()->default(null); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function(Blueprint $table) { + $table->dropColumn('discord_nickname'); + }); + } +}; diff --git a/resources/js/components/common/Footer.js b/resources/js/components/common/Footer.js index 361c1f7..71d8998 100644 --- a/resources/js/components/common/Footer.js +++ b/resources/js/components/common/Footer.js @@ -57,6 +57,15 @@ const Footer = () => { + + + {t('footer.muffins')} + + { {user.username} - #{user.discriminator} + {user.discriminator && user.discriminator !== '0' ? + #{user.discriminator} + : null}