]> git.localhorst.tv Git - alttp.git/blobdiff - app/Http/Controllers/TechniqueController.php
tech meta image
[alttp.git] / app / Http / Controllers / TechniqueController.php
index 1d51aff846f6f48910be8ae82c0e5e0d5483838a..b88b5a3c21645a94f2370b4ff2b76ab324f96d2a 100644 (file)
@@ -72,9 +72,15 @@ class TechniqueController extends Controller
        public function web(Request $request, $type, $name) {
                $tech = Technique::where('type', '=', $type)->where('name', '=', $name)->first();
                if ($tech) {
-                       return view('app')
+                       $view = view('app')
                                ->with('title', $tech->getTranslatedProperty('title'))
                                ->with('description', $tech->getTranslatedProperty('short'));
+                       if ($tech->image) {
+                               $view = $view->with('image', url($tech->image));
+                       } else if ($tech->gif) {
+                               $view = $view->with('image', url($tech->gif));
+                       }
+                       return $view;
                }
                $url_map = [
                        'dungeon' => 'dungeons',