]> git.localhorst.tv Git - alttp.git/blobdiff - app/Http/Controllers/AosSeedController.php
basic aosr patcher
[alttp.git] / app / Http / Controllers / AosSeedController.php
diff --git a/app/Http/Controllers/AosSeedController.php b/app/Http/Controllers/AosSeedController.php
new file mode 100644 (file)
index 0000000..9aea748
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\Models\AosSeed;
+use Illuminate\Http\Request;
+
+class AosSeedController extends Controller
+{
+
+       public function byHash($hash) {
+               $seed = AosSeed::where('hash', '=', $hash)->firstOrFail();
+
+               if ($seed->race) {
+                       $seed->hide('seed');
+               }
+               if ($seed->mystery) {
+                       $seed->hide('settings');
+               }
+
+               return $seed->toJson();
+       }
+
+}