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

littledaggers's avatar

Seeking assistance in how to approach making pop up reminders delayed by time

I have a task of making pop up reminders 1 day and 7 days after making a new entry and showing it in the blade. I want to have these reminders pop up automatically after the specified duration, and not be dismissed until a certain button is clicked. How to approach the whole task? What should I use?

Thank you in advance!

0 likes
9 replies
sr57's avatar

@littledaggers

Have a Reminder model with a field "validated"

In your blade show all your reminders not validated with the relevant filter (user, ...)

Use your a Validate button face each reminder to validate this reminder.

1 like
Tray2's avatar
Tray2
Best Answer
Level 73

You use a modal for the message.

Something like this

Html

<section id="info-modal" class="modal is-hidden">
		<div class="info-modal-content">
			<h3 id="info-header"></h3>
			<div >
				<button id="info-ok-btn" onclick="closeInfo()" class="btn">Ok</button>
			</div>
		</div>
	</section>

CSS

.modal {
	z-index: 10;
	position: absolute;
	top:0;
	left:-5px;
	width: 100%;
	height: 100%;
	overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.info-modal-content {
	background-color: rgb(194, 201, 221);
	margin: 15% auto; 
    padding: 20px;
    border: 1px solid #888;
    width: 80%; 
}

JS

function showInfo(infoText) {
    let infoHeader = document.querySelector('#info-header');
    let sound = document.querySelector('#attention-sound');
    let modal = document.querySelector('#info-modal');
    sound.play();
    infoHeader.innerHTML = infoText;
    show(modal);
}

function closeInfo() {
    hide(document.querySelector('#info-modal'));
} 
1 like
littledaggers's avatar

@sr57 @tray2 Thank you for your answers!

I additionally seek how to make them automatic with time, popping up after 1 day and after 7 days. @sr57 is that related to the "validated" field?

how could I use the Carbon Class to make sure that every entry gets the pop ups related to it?

Tray2's avatar

@littledaggers I guess you only want to display it once on day 1 and day 7. Then you need to do a check in your blade view to set some variable to know if you should display it or not. You could probably use the session for that.

1 like
littledaggers's avatar

@Tray2 I want it to keep popping up until a certain button in the modal is clicked, because it will be related to a huge database and I want the user to not dismiss the action and forget to do it under the pressure of work. Thank you for your insight!

Tray2's avatar

@littledaggers Then you will annoy your users, but that is up to you. I much rather would have put in some safe guards to make sure that everything is done before persisting it

1 like
littledaggers's avatar

@Tray2 I'm making it as suggested by the users themselves, they want me to implement a popup that keeps appearing until they seek action, I guess they need to see it in action to see if it will be annoying to them in the future or not

1 like
sr57's avatar

@littledaggers

after 1 day and after 7 days

I forgot this point in my answer, you have to have 2 fields validated ( validated1 & validated7), then the logic is the same.

1 like

Please or to participate in this conversation.