Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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
Comment

PREVIOUS NEXT
Code Example
Php :: how to get the current year in php 
Php :: laravel print log 
Php :: sha256 in php 
Php :: date format in laravel month name day name 
Php :: add custom user meta and display it in user page 
Php :: how to save information on pdf file in laravel project 
Php :: wherein laravel 
Php :: show display error php 
Php :: php object foreach 
Php :: cache clear in laravel 
Php :: how to truncate the given string to the specified length in blade.php 
Php :: php confirm box 
Php :: php check if date is older than 1 month 
Php :: browser detection php 
Php :: object values to array php 
Php :: wordpress get custom post type posts 
Php :: laravel blade check if yielded content exists 
Php :: how to uninstall php from mac catalina completely 
Php :: php array size 
Php :: mysqli real escape string php 
Php :: PHP strtotime() Function 
Php :: php insert hyphen into spaces in string 
Php :: check session php 
Php :: laravel Command "laravel/ui" is not defined. 
Php :: php str to int 
Php :: acf wp_query custom field 
Php :: How to create a controller in laravel 
Php :: laravel unique validation 
Php :: uuid in laravel 
Php :: force delete soft delete laravel 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =