I have in my Form Request , a Rule that Verify Captcha -
use App\Rules\VerifyCaptcha;
public function rules()
{
return [
'captcha' => ['required' , new VerifyCaptcha() ]
];
}
verify VerifyCaptcha.php Rule File -
public function passes($attribute, $value)
{
if($value == Session::get('captcha')){
return true;
}
return false;
}
Before , in Laravel 5.8 , this code used to works , but in Laravel 6 . SESSION IS NOT WORKING INSIDE THE RULE ,
I tried inside the form request as well . It does not work .
I tried ass well -
public function passes($attribute, $value)
{
if($value == session()->get('captcha')){
return true;
}
return false;
}
If I print this in my controller , it works -
class SiteController extends Controller
{
public function index()
{
dd(session()->get('captcha'));
}
}
BUT INSIDE MY RULE IT IS NOT WORKING ANY MORE . IN LARAVEL 5.8 IT USED TO WORK .