Build a Monthly Subscription App with Laravel Cashier: Lesson 29 of 36

Blade Conditionals

Up Next

Account Page Setup

Autoplaying in 7 seconds!


Since we have the Billable trait on our User model, we have access to some methods that will show us if a user is subscribed or not. Here are some of the important methods:

Table of Contents

    // is a user subscribed?
    Auth::user()->subscribed('main');   // checks a certain subscription (main). returns true/false
    // did the user cancel? but still has an active subscription?
    // is a user on a certain plan? (bronze/silver/gold)
    Auth::user()->onPlan('bronze');     // returns true/false
    // check if a user had a subscription and cancelled (no longer in grace period)

    Chris Sevilleja

    173 posts

    Founder of Google Developer Expert in Web Technologies. Slapping the keyboard until something good happens.