Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

christopher's avatar

Cashier - access subscription table

Does somebody know how i can access the subscription table in cashier from my user model?

Tried different things like

$request->user()->subscription->ends_at;
$request->user()->subscription()->ends_at;

But i cant access the subscription table from my user model.

I want to show the current named stripe plan and the ends_at date.

0 likes
1 reply
christopher's avatar
christopher
OP
Best Answer
Level 30

Okay solved it. Looked into the Billable trait

/**
     * Get all of the subscriptions for the user.
     *
     * @return \Illuminate\Database\Eloquent\Collection
     */
    public function subscriptions()
    {
        return $this->hasMany(Subscription::class)->orderBy('created_at', 'desc');
    }

so i can access the users subscription with

$request->user()->subscriptions

Please or to participate in this conversation.