mardi 18 février 2020

how to send a message with login in Laravel?

I have this function for log but I have an error in the compact

public function redirectPath()
{
    if (Auth::user()){

        $msg_modal = 1;
        return '/', compact('msg_modal');
}

to run this script which show me a modal

@if(!empty($msg_modal) && $msg_modal == 1)

<script>
$(function() {
$('#mostrarmodal').modal('show');
});
</script>

@endif

This is the modal that I would like to see when I log

<div class="modal fade" id="mostrarmodal" tabindex="-1" role="dialog" aria-labelledby="basicModal" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
       <div class="modal-header">
          <h3><center>System</center></h3>
       </div>
       <div class="modal-body">
          <h4><center>Message</center></h4>
          <center>You are connected!!!</center>
      </div>
       <div class="modal-footer">
      <a href="#" data-dismiss="modal" class="btn btn-info">Continuar</a>
       </div>
  </div>


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire