Skip to content

Instantly share code, notes, and snippets.

@ercanertan
Last active December 13, 2018 12:16
Show Gist options
  • Save ercanertan/66ca7039adeaef3004c8bedeb48758e5 to your computer and use it in GitHub Desktop.
Save ercanertan/66ca7039adeaef3004c8bedeb48758e5 to your computer and use it in GitHub Desktop.
Popup Example
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-body">
<h1>Sample</h1>
</div>
</div>
</div>
</div>
</div>
<?php
$popup_url = "/"
?>
<?php if( $_SERVER["REQUEST_URI"] == $popup_url):?>
<?php if (isset($_COOKIE['key'])): ?>
<?php if ($_COOKIE['key']=='show'): ?>
<script type="text/javascript">
$( document ).ready(function() {
$("#myModal").modal();
{{ \Cookie::queue('pop_up', 'hide', 1) }}
});
</script>
<?php endif; ?>
<?php else: ?>
<?php endif; ?>
<?php endif; ?>
//Controller or blade
if(is_null(Cookie::get('pop_up'))){
Cookie::queue('pop_up', 'show', 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment