jeudi 3 mai 2018

how do I change the image of a button via eloquent?

how do I change the image of a button, only with values of 0 and 1 ( $table -> boolean('alugado');) of a database eloquent in laravel?

this is my button

 <div class="inputbutton">
 <span class="text">text</span>
 <input type="submit" class="btTxt submit" value=""  id="text" onclick="reply_click(this.id)"></div>

this is my migration file

    Schema::create('chav',function (Blueprint $table){
        $table -> increments('id');
        $table -> string('nome');
        $table -> boolean('alugado');
        $table -> timestamps();
    });

my function ajax

      function reply_click(clicked_id){
    $(function() {
        $.ajaxSetup({
           headers: {
              'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
           }
        });
        $('#openButton').on('click', function(data) {
            $.ajax({
              type: "PATCH",
              url: "/dash"
            })
        });
    });
}



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2wixS4P
via IFTTT

Aucun commentaire:

Enregistrer un commentaire