remaining_images == -1 or Auth::user()->remaining_images > 0) { return $next($request); } return back()->with(['message' => 'Insufficient credits to create.', 'type' => 'error']); } }