title: Laravel redirect user to playstore app of android when someone access a url(GET REQUEST) in browser of android device
body: <p>I am trying to redirect a user to android playstore or ios playstore where my app is stored when they visit my website.I want to achieve this with laravel.</p>
  
  <p>I got the status of the device they are using:</p>
  
  <pre><code>    $agent = new Agent();
      if($agent-&gt;isMobile()|| $agent-&gt;isTablet()){
          if($agent-&gt;isAndroidOs()){
              return "android";
          }
          elseif($agent-&gt;is('iPhone')){
              return "ios";
          }
      }
      else if($agent-&gt;isDesktop()){
          $browser = $agent-&gt;browser();
          echo "Browser:".$browser."&lt;br&gt;";
          echo "Platform:".$agent-&gt;platform()."&lt;br&gt;";
          echo "Version of Platform:".$agent-&gt;version($agent-&gt;platform())."&lt;br&gt;";
          echo "Device:"."Desktop";
          return redirect('http://google.com');
      }
      else{
          return "Couldn't identify";
      }
  </code></pre>
  
  <p>Here,is the output:
  <a href="http://i.stack.imgur.com/GMDXO.png" rel="nofollow">preview of the output when I access in my browser</a>
  Browser:Chrome
  Platform:Windows
  Version of Platform:6.1
  Device:Desktop</p>
  
  <p>The above code works fine.What I need now is,I want to find a way to redirect the user to store and display the app I specify in ios,android.</p>
  
  <p>Can anyone give me the code to do that.I know that this can be done with the headers the server receive.But,I don't know how to use it in the code.</p>
  
  <p>Please help.I want to do this in laravel 5.1.</p>