Relative Content

Tag Archive for laravellaravel-cashierlaravel-11

if ($request->user() && ! $request->user()->subscribed(‘prod_QbjA3oKZmzyBAj’)) {return redirect(‘subscribe’);} always return true

This maybe a silly question but i had to ask, I am using laravel 11, where i am making a subscription page using laravel cashier(stripe) and when I’m making a page that only users who have subscribed can access the page so i am using a middleware PayingCustomer.php in that i am using the if conditon as mentioned in https://laravel.com/docs/11.x/cashier-paddle#checking-subscription-status this is the code of middleware:

if ($request->user() && ! $request->user()->subscribed(‘prod_QbjA3oKZmzyBAj’)) {return redirect(‘subscribe’);} always return true

This maybe a silly question but i had to ask, I am using laravel 11, where i am making a subscription page using laravel cashier(stripe) and when I’m making a page that only users who have subscribed can access the page so i am using a middleware PayingCustomer.php in that i am using the if conditon as mentioned in https://laravel.com/docs/11.x/cashier-paddle#checking-subscription-status this is the code of middleware: