'id' => 'array',
'id.*' => 'integer|numeric',
'joinable' => 'boolean|nullable',
+ 'joined' => 'boolean|nullable',
'limit' => 'numeric|nullable',
+ 'logging' => 'boolean|nullable',
'manageable' => 'boolean|nullable',
'phrase' => 'string|nullable',
]);
if (isset($validatedData['joinable']) && $validatedData['joinable']) {
$channels = $channels->where('twitch_chat', '!=', '');
}
+ if (isset($validatedData['joined'])) {
+ $channels = $channels->where('join', '=', !!$validatedData['joined']);
+ }
+ if (isset($validatedData['logging'])) {
+ if (!!$validatedData['logging']) {
+ $channels = $channels->where('chat', '=', true);
+ $channels = $channels->orWhere('join', '=', true);
+ } else {
+ $channels = $channels->where('chat', '=', false);
+ $channels = $channels->where('join', '=', false);
+ }
+ }
if (isset($validatedData['manageable']) && $validatedData['manageable']) {
$user = $request->user();
if (!$user) {