Resetting Plan-Based Subscription In Laravel [closed] - php

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I am trying to develop a system where a user can buy a premium subscription for a certain amount of time (maybe a month or a week) however upon expiration of this subscription, I want to reset the user back to basic plan on Laravel.
I have been researching this, and I was able to find a way that has to do with setting up cron jobs based on the plan subscription length.
Is this the best way possible? And if yes, is there a way I can set up crons in Laravel controllers (i.e after the user's payment is confirmed).

The way I would go about this is to have a date the subscription ends for that user within the database. You can then alter your business logic, ui etc so that they get the correct experience depending on whether this date has passed or not yet.

Related

Laravel Best Practice for save user activity log in database ( with considering database Performance) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I have a website (Laravel + Mysql on top of 'dedicated server') where I save all the pages that every user sees for reporting.
My site is visited 10,000 times a day and this statistic makes the database size bigger after a few months. now 'visits' table occupied 85% of whole database!
Is there a way to do this that is the best way possible?
I have not encountered this problem before, but I think its better to take the logging with this much of heavy load out of primary database, you can move it to a file system or logging services (read this).
Or you can have job (background process) to remove the logs that you don't need Like logs from a month ago, this will help db a little bit.
Read some best practices

Count the amount of users that are logged in [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am working on a school project. The assignment is to recreate our own version of Ebay. A requirement is to display the number of logged in users. What is the best way to do this? We are using PHP.
We are using a database so we could save the amount of loggins there but there is no proper way to decrease this amount since people often just leave the site without logging out.
Some suggestions would be awesome!
you could have a heartbeat script that updates a datetime on the user column.
and the show logged in users script could get all logged in users with time < 5 mins

Best way to store stats of multiple people weekly [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I am using the Clash Of Clans api to show all the members of the clan on a web page. But now I want to save all the donations, cups and received donations on a weekly base. So i can see in a very clear overview who are the most active members. But the thing is. I just don't know how to design the database. I was thinking to create a table every week that would look like this: StatsWeek[number]: (MemberTag, Donations, DonationsReceived, Cups). But then at some point i will have a large amount of tables. So I tought there has to be a more efficient way. But I can't think of a better way.. I am using a MySql Database
Like mentioned in the comments, it's better to store everything in a single table... you can save weekly transactions(or daily, whatever interval you choose). Here is an example schema for you.
To find, for example, troops donated on any given week; you will have to subtract the previous weeks donations from that weeks donations.

Paypal API - Returning failed recurring account transactions [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I was wondering if there was a way to return a list of failed recurring account transactions.
I have a client who wants to have the actual list embedded on his site and doesn't want to have to log into the dashboard every single time.
I have looked all through the API yet I cannot find anything about it.
A good direction on where to look would really help as well.
Thank you.
There isn't any API that will return those directly, but you could use Instant Payment Notification (IPN) to save details about recurring payments / profiles.
Any time a new profile is created or a payment is completed, skipped, failed, etc. you would get an IPN for that transaction. Within your IPN script you can save details to your database and then pull from your own database to display the data however you need.

How to limit the number of active sessions a user can have [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am buiding a licence style system where a user can buy one or a number of licences. They can then log in to the system only once with each licence (similar to Spotify). So a user buys 2 licences. They can log in once in Firefox and once with Chrome. If they try to log in using IE the system will prompt/warn that they will be logged out of another session.
I understand a user could just use multiple instances of the same browser to gain access to multiple sessions/screens but thats fine. We are really only trying to stop users from using multiple devices (2+ separate PCs) if their licence restricts.
Any idea how I would go about this? Can I check session data from another instance or should I store the logins in a separate table and check against that?
Thanks

Categories