How to filter data using country,state and city dropdown in microservice

Step 1: create dropdown div block in blade file

Step 2: write jQuery key up and change function

Step 3:pass URL in ajax function for client side microservice

step 4: set routing

$tourcontroller = $namespace.’\TourDetailController’;
Route::get(‘toursdetail/{email}’,”$tourcontroller@gettrip”);

Step 5: write function in client side controller

Step 6: set env and app.php to connect between client and serverside for microservice

GET_MYHOLIDAYTRIP_URL=/api/v1/j/gettripdetail

Step 7: Set routing server side

Route::get(‘gettripdetail/{email}’, ‘Admin\AdminTPController@tripdetail’);

Step 8: create function in server side controller

now run finally project

Tagged : /

How to Add Facebook Comment in HTML page

In this tutorial I’m going to describe how to add facebook comment in html page, please follow some easy steps its helpful for you.

1st step go to Facebook for Developers Facebook comment

2 nd step: Paste your website URL which website you want to show facebook comment.

Next you’ll get Code 1st code put in after body tag and 2nd put in where you want to show Facebook comment section in your page.

Go to you page and Copy below code and paste below the body tag.

<div id="fb-root"></div>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v10.0&appId=427021281892903&autoLogAppEvents=1" nonce="IFt1dfew"></script>

Next step Copy below code and simply paste there where you want to show Facebook comment in your html page.

<!-- fb comment show here  -->
<div class="fb-comments" data-href="http://www.surgeryplanet.com/" data-width="100%" data-numposts="10"></div>
<!-- fb comment show end -->

Next in your page facebook comment is working as like this->

Thanks 🙏🙏

Tagged : / / / /

How to set a selected option using ajax in Laravel 5.6?

Hey friends, I am trying to show database column data in my edit form of a Laravel project. yesterday I failed to show data from database in a select list using ajax. so let’s see the below blade file and ajax also to get your solution.

edit.blade.php
<div class="form-group">
  <label for="Blood_Group">Blood Group</label>
	<select class="form-control" id="bgroup" name="bgroup">
	  <option value="" disabled selected>Select BG</option>
	  <option value="O+">O+</option>
	  <option value="O-">O-</option>
	  <option value="A+">A+</option>
	  <option value="A-">A-</option>
	  <option value="B+">B+</option>
	  <option value="B-">B-</option>
	  <option value="AB+">AB+</option>
	  <option value="AB+">AB-</option>
	</select>
</div>
profile.js
$.ajax({
	type: "GET",
	url: 'addprofile',
	data: null,
	success: function(response) {
          let data = response.data;
          $("#bgroup").append('<option value=' + data[0].bgroup+ '>' + data[0].bgroup+ 
           '</option>');

        }
});

Error : updated data from database is not showing in selected list when i am trying to update it again.

Solution :
$("#bgroup").val(data[0].bgroup).attr('selected','selected');

You can also use below code:

$('#bgroup option[value="' + data[0].bgroup+ '"]').prop('selected', true);

Above solution is working for me. so if you have more solution on select option then please feel free to comment and share your knowledge.

Resources :

  1. Click here
  2. Click here

Tagged : / / / /