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

theUnforgiven's avatar

Cashier question

I have Cashier all setup and working, but I'm using the protected $cardUpFront = false; property which involves adding this $user->trial_ends_at = Carbon::now()->addDays(14); to the user model. So in effect there's no Stripe account until the customer enters their card details.

I want to be able to show invoices, but need someway to check that invoices exist on the customer account or else show nothing.

I have tried the following:

$inv = Auth::user();
$invoices = $inv->invoices();

So this works if there's an active stripe account, but then shows errors if there's nothing, what would be the best way to check?

I also tried in my view:

@if(count($invoices))
   // Rest of code
@endif

But still doesn't work as expected. Anyone have any suggestions?

0 likes
5 replies
theUnforgiven's avatar

I also tried @if(Auth::user()->subscribed() ) but still to no avail.

Anyone.

jekinney's avatar

Post a dd() of the results. I expect your getting a not found error.

theUnforgiven's avatar

Yeah either a not found error or saying that a Stripe ID or something doesn't exist.

SO need a good way to do a couple of checks to only show if stripe is valid, because as I stated this only adds a trial_ends_at timestamp and doesn't create a customer within Stripe, so stripe doesn't know this customer actually exists until they enter their card details.

Please or to participate in this conversation.