document.querySelector('.sil').onclick = function(){
swal({
title: "Are you sure?",
text: "You will not be able to recover this imaginary file!",
type: "warning",
showCancelButton: true,
confirmButtonClass: 'btn-danger',
confirmButtonText: 'Yes, delete it!',
cancelButtonText: "No, cancel plx!",
closeOnConfirm: false,
closeOnCancel: false
},
function(isConfirm){
if (isConfirm){
swal("Deleted!", "Your imaginary file has been deleted!", "success");
} else {
swal("Cancelled", "Your imaginary file is safe :)", "error");
}
});
};
bu myjs.js dosyam public klasörü altında
@extends('layouts.master')
@section('content')
<div class="container">
....tarihine ait veriler
<table class="table table-striped table-bordered table-hover">
<thead>
<tr class="bg-info">
<th>Id</th>
<th>Tarih</th>
<th>Masraf Kodu</th>
<th>Açıklama</th>
<th>Giren</th>
<th>Çıkan</th>
<th colspan="3">İşlemler</th>
</tr>
</thead>
<tbody>
@foreach ($verilers as $veriler)
<tr>
<td>{{ $veriler->id }}</td>
<td>{{ $veriler->tarih }}</td>
<td>{{ $veriler->masraf_kodu }}</td>
<td>{{ $veriler->aciklama }}</td>
<td>{{ $veriler->giren }}</td>
<td>{{ $veriler->cıkan}}</td>
<td colspan="2"><a href="#" data-toggle="modal" data-target="#modal" class="btn btn-warning" style="float:left;margin-right:10px;">Güncelle</a>
{!! Form::open(['method' => 'DELETE', 'route'=>['datas.destroy', $veriler->id]]) !!}
{!! Form::submit('Sil', ['class' => 'btn btn-danger sil']) !!}
{!! Form::close() !!}
</td>
</tr>
@endforeach
<tr style="background-color: gray;">
<td colspan="3"></td>
<td>TOPLAM=></td>
<td>GİRİŞ TOPLAM</td>
<td>ÇIKIŞ TOPLAM</td>
</tr>
</tbody>
</table>
@endsection
bu veriler.blade.dosyam
<!DOCTYPE html>
<html>
<head>
<title>Giriş Sayfası</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link href="{{ asset('css/style.css') }}" rel="stylesheet" type="text/css" >
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
</head>
<body>
<div class="container">
@include('sidebar.navigation')
@yield('content')
</div>
<script src="dist/sweetalert.min.js"></script>
<link rel="stylesheet" type="text/css" href="dist/sweetalert.css">
<script type="text/javascript" src="{{ asset('js/myjs.js') }}"></script>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</body>
</html>
buda master.blade.php sayfam