Senin, 30 Oktober 2017

membuat pop up konfirmasi delete/hapus di laravel (pop up confirmation delete in laravel)

<td>
        <a href='{{URL::action("admin\GalleryController@edit",array($gallery->id))}}'>edit</a>
        <a href='{{URL::action("admin\GalleryController@show",array($gallery->id))}}'>show</a>
        {{ Form::open(array(
'action'=>['admin\GalleryController@destroy', $gallery->id],
'method'=>'DELETE',
'id' => $gallery->id,
'style' => 'display:inline'
)) }}

<button class='btn btn-sm btn-danger delete-btn'
type='button'
data-judulbuku='{{$gallery->judul}}'
data-formid='{{$gallery->id}}'>
<i class='fa fa-times-circle'></i> Hapus
</button>
{{ Form::close() }}
<script>
    $(".delete-btn").on("click", function (e) {
    e.preventDefault();
    var self = $(this);
    var judul = $(this).attr("data-judulbuku");
    var formid = $(this).attr("data-formid");
        swal({
            title: "HAPUS",
            text: "Hapus Data Gallery Judul : "+judul+" ?",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "Ya, Hapus !",
            closeOnConfirm: true
        },
                function () {
                    $("#"+formid).submit();
                });
    });
</script>
        </td>

Minggu, 08 Oktober 2017

Error migrate string ( Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes)

Tambahkan script default string di file AppServiceProvider.php

use Illuminate\Support\Facades\Schema;

public function boot()
    {
        Schema::defaultStringLength(191);
    }

Sabtu, 07 Oktober 2017

cara update php dan mysql di ubuntu (requirment laravel)




sudo apt-get install php-mbstring
sudo apt-get install php-xml



sudo apt-get install php7.1-mysql