]> git.localhorst.tv Git - alttp.git/blobdiff - app/Http/Controllers/TechniqueController.php
expand tech
[alttp.git] / app / Http / Controllers / TechniqueController.php
index a1ba20e59ac214877b46d815bcd6084d150a7df0..268c3f6abeff765568efd68209edc79942363c81 100644 (file)
@@ -12,10 +12,15 @@ class TechniqueController extends Controller
        public function search(Request $request) {
                $validatedData = $request->validate([
                        'phrase' => 'string|nullable',
+                       'type' => 'string|nullable',
                ]);
 
                $techs = Technique::where('index', '=', 1);
 
+               if (!empty($validatedData['type'])) {
+                       $techs = $techs->where('type', '=', $validatedData['type']);
+               }
+
                if (!empty($validatedData['phrase'])) {
                        $search = $validatedData['phrase'];
                        $techs = $techs->where(function (Builder $query) use ($search) {