]> git.localhorst.tv Git - alttp.git/commitdiff
add tech gif
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 24 Aug 2023 20:16:51 +0000 (22:16 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 24 Aug 2023 20:16:51 +0000 (22:16 +0200)
app/DiscordAppCommands/AlttpTechCommand.php
database/migrations/2023_08_24_201527_add_tech_gif.php [new file with mode: 0644]

index d97cfee544a78ca93254d5970230bb06ec43588a..ac341ba46b22282d7b3b53e9dd9b5ea71f5944ca 100644 (file)
@@ -47,7 +47,11 @@ class AlttpTechCommand {
                                                                'type' => 'rich',
                                                                'url' => url('/tech/'.rawurlencode($tech->name)),
                                                        ];
-                                                       if ($tech->image) {
+                                                       if ($tech->gif) {
+                                                               $properties['image'] = [
+                                                                       'url' => url($tech->gif),
+                                                               ];
+                                                       } else if ($tech->image) {
                                                                $properties['image'] = [
                                                                        'url' => url($tech->image),
                                                                ];
diff --git a/database/migrations/2023_08_24_201527_add_tech_gif.php b/database/migrations/2023_08_24_201527_add_tech_gif.php
new file mode 100644 (file)
index 0000000..a988ae4
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+       /**
+        * Run the migrations.
+        *
+        * @return void
+        */
+       public function up()
+       {
+               Schema::table('techniques', function(Blueprint $table) {
+                       $table->string('gif')->nullable()->default(null);
+               });
+       }
+
+       /**
+        * Reverse the migrations.
+        *
+        * @return void
+        */
+       public function down()
+       {
+               Schema::table('techniques', function(Blueprint $table) {
+                       $table->dropColumn('gif');
+               });
+       }
+};