Skip to main content

Posts

Showing posts from September, 2018

Ajax Call using post method

//ajax call using post method <meta name="csrf-token" content="{{ csrf_token() }}"> // in master blade in blade where ajax call is needed $.ajax({ url:"/billfinalsave", contentType: 'application/json', data: jsonString,//JSON.stringify( { "first-name": 'affaa', "last-name": 'ertyu' } ), headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}, method:'post', success:function (resp123) { debugger; console.log("resp:"+resp123['bill_id']); console.log("product_item:"+resp123['product_item'][0].product_id); console.log("Quantity:"+resp123['product_item'][0].quantity);

facebook share button on laravel

https://laracasts.com/discuss/channels/general-discussion/facebook-share?page=0   <a href="https://www.facebook.com/sharer/sharer.php?u=YourPageLink.com&display=popup"> share this </a> https://developers.facebook.com/docs/plugins/like-button#configurator https://sujipthapa.co/blog/a-complete-guide-to-integrate-facebook-like-and-share http://www.tutoriallaravel.com/laravel-example/laravel-social-share-button/  <a href="https://www.facebook.com/sharer/sharer.php?u=sabinbajgain.com.np" display="popup" target="_blank"> share this </a> <button><a class=".social-share" href="https://www.facebook.com/sharer/sharer.php?u=sabinbajgain.com.np" target="_blank"> Share on Facebook </a></button><br>  <a href="https://twitter.com/intent/tweet?url={{ urlencode(Request::fullUrl()) }}" target="_blank"> Share on Twitter </a>

add css and class dynamically using jquery

<script> $ (window). on ( 'load' , function () { // var pathname = window.location.pathname; // Returns path only var url = window.location.href ; // Returns full URL // var origin = window.location.origin; var words = url. split ( '#' ) ; var check=words[ 1 ] ; // alert(check); if (check== 'how' ) { // alert("this is how"); // var element=document.getElementById('how'); // hownav=display:inline // how=active // console.log("yo ho:"+element); $ ( '#how' ). addClass ( 'in active' ) ; $ ( '. checkactive4 ' ). removeClass ( 'in active' ) ; $ ( "#hownav" ). css ( "display" , "inline" ) ; // element.addClass("active"); } if (check== 'what' )

carasole of 6 6 element dynamic

Controller: case 'article' : $datas = DB:: table ( 'articles' )-> OrderBy ( 'id' , 'desc' )-> get () ; foreach ( $datas as $data ) { array_push( $arr , $data -> id ) ; } $count =count( $arr ) ; $page = $count / 6 ; // dd($page); return view( 'front.viewall' , compact( 'datas' , 'cat' , 'count' , 'page' )) ; <div class= "carousel-inner picturesliderimage" > <?php $tmp = 0 ; ?> @for( $i = 0 ; $i < $page ; $i ++ ) @if( $i == 0 ) <div class= "item active" > @else <div class= "item" > @endif <div class= "row" style= " margin-top : 50 px" > @for( $j = 0 ; $j == 0 |

Khalti Integration

blade for api @extends( 'layouts.frontMaster' ) @section( 'content' ) <!--suppress ALL --> <br> <br> <br> <html> <head> <script src= "https://code.jquery.com/jquery-3.3.1.min.js" integrity= "sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin= "anonymous" ></script> <script src= "https://khalti.com/static/khalti-checkout.js" ></script> </head> <body> ... <!-- Place this where you need payment button --> <button id= "payment-button" > Pay with Khalti </button> {{--<button id="payment-button" onclick="clickedbtn()">Clickme</button>--}} <!-- Place this where you need payment button --> <!-- Paste this code anywhere in you body tag --> <script> var conf

export db to excel

https://laravelcode.com/post/excel-and-csv-import-export-using-maatwebsite-in-laravel-example(not working) https://packalyst.com/packages/package/maatwebsite/excel https://packagist.org/packages/maatwebsite/excel https://laravel-excel.maatwebsite.nl/3.0/getting-started/installation.html https://laravel-excel.maatwebsite.nl/3.0/getting-started/installation.html this final one is already created package by other but works well for me: https://github.com/rap2hpoutre/fast-excel

only number input in text field or removing styles updown arrow fron number

<div class= "form-group " > <label for= "barcode_no" > Barcode No </label> <input class= "form-control" type= "text" onkeypress= " return event. charCode >= 48 && event. charCode <= 57 " name= "barcode_no" id= "barcode_no" value= " {{Request:: old ( 'barcode_no' )}} " placeholder= "Enter Barcode If You Have" > </div> <style type= "text/css" > /* For Firefox */ input [ type = 'number' ] { -moz-appearance : textfield ; } /* Webkit browsers like Safari and Chrome */ input [ type = number ]:: -webkit-inner-spin-button , input [ type = number ]:: -webkit-outer-spin-button { -webkit-appearance : none ; margin : 0 ; } </style>

use of osm or mapbox in leaflet

http://bl.ocks.org/mapsam/6175692     <!DOCTYPE html> <html> <head>     <title>Layers Control Tutorial - Leaflet</title>     <meta charset="utf-8" />     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />     <link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css"           integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ=="           crossorigin=""/>     <script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"             integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw=="             crossorigin=""></script>      <style>