I'm working on a Laravel 9 project and I'm trying to add arrays of staff access passcodes but I keep getting this error every time I type in the correct passcode: in_array(): Argument #2 ($haystack) must be of type array, null given
Heres the code:
public function access(Request $request)
{
$access_pass = config('web.offlinePass');
if (!in_array($request->pass, $access_pass))
return back()->withErrors(['The password entered is incorrect!']);
session()->put('admins_only', $request->pass);
session()-save();
return redirect()->route('website.dash.dash');
}
$access_passin thein_arrayisnull. Double check your web.php config.config/web.phpfile and insidereturn ['offlinePass' => ['array', 'of', 'values']];. Variableadmins_onlyis used in session from what I see.