Posts

Showing posts from July, 2019

How to send an Email in Laravel using Gmail SMTP Server

.env File #old MAIL_DRIVER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null #NEW MAIL_DRIVER=smtp MAIL_HOST=smtp.googlemail.com MAIL_PORT=465 MAIL_USERNAME=darsh@gmail.com MAIL_PASSWORD=123456 MAIL_ENCRYPTION=ssl Step 2: Configure your Google Account Login to your Google Email Account and click on Google Account Button. This button is displayed when you click on the profile picture in your Gmail Dashboard as shown. Once you are on My Account Page then click on Security and scroll down to the bottom and you will find ‘Less secure app access’ settings. Click on the radio button to set it ON. Reference link

On Change Dropdwon Change Price

Form: < select class = "form-control" id = "{{'qty-'. $product -> product_id }}" onchange = "changePrice({ { $product -> product_id } })" > @ foreach ( $productVegetabledetail as $productVarient ) < option value = "{{ $productVarient -> varient }}-{{ $productVarient -> price }}" >{{ $productVarient -> varient . '-' .( $productVarient -> unit == 1 ? 'kgs' : 'grms' )}}</ option > @ endforeach </ select > Javascript: < script type= "text/javascript" > function changePrice(productId) { var price = $( "#qty-" + productId ).val(); var array = price . split ( "-" ); var totalPrice = parseFloat( array [ 1 ]).toFixed( 2 ); document .getElementById( "price-" + productId ). innerHTML = totalPrice + '<i class="mdi mdi-currency-inr"></i>' ; } </ scrip...

Dynamic Form Update Delete Insert

Image
example Form: < div id= "main" > < table class= "table table-stripped variant_range" > < thead > < tr > < th >< label for= "variant" >< strong > Variant </ strong ></ label ></ th > < th >< label >< strong > Unit (kgs/grms) </ strong ></ label ></ th > < th >< label >< strong > Price </ strong > ( < i class= "fa fa-inr" ></ i > ) </ label ></ th > < th > < input type= "hidden" id= "count" name= "count" value= "0" > < a class= "btn btn-sm btn-success" href= "javascript:void(0)" onclick= " addData () " >< i class= "fa fa-plus-circle" ></ i > Add Item </ a > </...

Dynamic Form Insert

Image
example Form: < div id= "main" > < table class= "table table-stripped variant_range" > < thead > < tr > < th >< label for= "variant" >< strong > Variant </ strong ></ label ></ th > < th >< label >< strong > Unit (kgs/grms) </ strong ></ label ></ th > < th >< label >< strong > Price </ strong > ( < i class= "fa fa-inr" ></ i > ) </ label ></ th > < th > < input type= "hidden" id= "count" name= "count" value= "1" > < a class= "btn btn-sm btn-success" href= "javascript:void(0)" onclick= " addData () " >< i class= "fa fa-plus-circle" ></ i > Add Item ...

Ajax Toggle(on/off) on-click Update

example  Index : < td > < a href= "javascript:void(0)" data-toggle= "tooltip" onclick= " toggleProductStaple({{ $item -> id }},{{ $item -> is_staple }}) " > @if ( $item -> is_staple === 1 ) < i data-toggle= "tooltip" data-original-title= "Active" class= "fa fa-toggle-on text-inverse m-r-10" ></ i > @else < i data-toggle= "tooltip" data-original-title= "Inactive" class= "fa fa-toggle-off text-inverse m-r-10" ></ i > @endif </ a > </ td > function: < script > function toggleProductStaple (product_id, is_staple) { $ . ajaxSetup ({ headers : { 'X-CSRF-TOKEN' : $ ( ' meta [name="_token"]' ). attr ( 'content' ) } }); $ . ajax ({ type : "post...