]> git.localhorst.tv Git - alttp.git/blobdiff - app/Http/Controllers/ChannelController.php
set channel on GG controls open
[alttp.git] / app / Http / Controllers / ChannelController.php
index f7d57c037137cb330d1fec49036952e3e701e664..dec17e90e7273f5d98cae2e6c0901c2bed0d7ee6 100644 (file)
@@ -13,12 +13,17 @@ class ChannelController extends Controller {
 
        public function search(Request $request) {
                $validatedData = $request->validate([
+                       'id' => 'array',
+                       'id.*' => 'integer|numeric',
                        'joinable' => 'boolean|nullable',
                        'manageable' => 'boolean|nullable',
                        'phrase' => 'string|nullable',
                ]);
 
                $channels = Channel::query();
+               if (!empty($validatedData['id'])) {
+                       $channels = $channels->whereIn('id', $validatedData['id']);
+               }
                if (isset($validatedData['joinable']) && $validatedData['joinable']) {
                        $channels = $channels->where('twitch_chat', '!=', '');
                }