For the expire part you could use a middleware to check the status of the subscription. The emails you could check with a job that you run once a day to see if how many days there are left.
Something like this.
class CheckSubsription
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($request->today >= $user->dueDate) {
return redirect('paynowtocontinue');
}
return $next($request);
}
}
Read more here https://laravel.com/docs/5.7/middleware
if ($this->daysLeft == 30) {
SubscriptionReminder::ThirtyDayNotice();
else if ($this->daysLeft == 15) {
SubscriptionReminder::FifteenDayNotice();
}
Read more here https://laravel.com/docs/5.7/scheduling#scheduling-queued-jobs