i am using laravel cashier for subscription system , i implemented the payment like this :
public function orderPost(Request $request)
{
$user = auth()->user();
$input = $request->all();
$token = $request->stripeToken;
$paymentMethod = $request->paymentMethod;
$newSubscription = $user->newSubscription('default ', 'price_1IFyPsB9YMR57in7UrNtRb9G')->create($request->payment_method, ['email' => $user->email]);
dd($newSubscription);
and my view is like below :
<form action="{{route('order-post')}}" id="payment-form" method="post">
@csrf
{{-- {!! Form::open(['url' => route('order-post'), 'data-parsley-validate', 'id' => 'payment-form']) !!}--}}
@if ($message = Session::get('success'))
<div class="alert alert-success alert-block">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>{{ $message }}</strong>
</div>
@endif
<div class="form-group" id="product-group">
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<div id="card-element"></div>
</div>
</div>
</div>
<div class="form-group">
<button id="card-button" class="btn btn-lg btn-block btn-success btn-order">Place order !</button>
</div>
<div class="row">
<div class="col-md-12">
<span class="payment-errors" id="card-errors" style="color: red;margin-top:10px;"></span>
</div>
</div>
</form>
now what happens after i receive the dd the database is filled with data and stripe shows that i got this plan but i have one problem and thats like image below that the field ends_at has null value :

now i want to know how can i detect that when user account expires and if a user have active subscription or not . thanks .