Answers for "how to return with open model popup in laravel"

PHP
1

how to return with open model popup in laravel

//pass back a variable when redirecting
return Redirect::back()->with('error_code', 5);

//in blade tempalte
@if(!empty(Session::get('error_code')) && Session::get('error_code') == 5)
<script>
$(function() {
    $('#myModal').modal('show');
});
</script>
@endif
  
//second seneario use like this
  <script type="text/javascript">
    @if(!empty(Session::get('error_code')))
        <?php $a = Session::get('error_code'); ?>
        $('#updateCarModel{{ $a }}').modal('show');
        console.log("#updateCarModel{{ $a }}");
    @endif
</script>
//@sujay
Posted by: Guest on October-19-2020

Browse Popular Code Answers by Language