Skip to content

Commit 8d7408c

Browse files
committed
CRUD Parent added
Users log added
1 parent 00385ac commit 8d7408c

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
namespace Laraveldaily\Quickadmin\Controllers;
3+
4+
use App\Http\Controllers\Controller;
5+
use Laraveldaily\Quickadmin\Models\UsersLogs;
6+
use yajra\Datatables\Datatables;
7+
8+
class UserActionsController extends Controller
9+
{
10+
/**
11+
* Show User actions log
12+
*
13+
* @return Response
14+
*/
15+
public function index()
16+
{
17+
return view('qa::logs.index');
18+
}
19+
20+
public function table()
21+
{
22+
return Datatables::of(UsersLogs::with('users')->orderBy('id', 'desc'))->make(true);
23+
}
24+
}

src/Views/qa/logs/index.blade.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
@extends('admin.layouts.master')
2+
3+
@section('content')
4+
5+
<div class="portlet box green">
6+
<div class="portlet-title">
7+
<div class="caption">List</div>
8+
</div>
9+
<div class="portlet-body">
10+
<table class="table table-striped table-hover table-responsive" id="ajaxtable">
11+
<thead>
12+
<th>User</th>
13+
<th>Action</th>
14+
<th>Action model</th>
15+
<th>Action id</th>
16+
<th>Time</th>
17+
</thead>
18+
19+
<tbody>
20+
21+
</tbody>
22+
</table>
23+
</div>
24+
</div>
25+
26+
@endsection
27+
28+
@section('javascript')
29+
<script>
30+
$('#ajaxtable').DataTable({
31+
processing: true,
32+
serverSide: true,
33+
ajax: '{{ route('actions.ajax') }}',
34+
columns: [
35+
{data: 'users.name', name: 'user_id'},
36+
{data: 'action', name: 'action'},
37+
{data: 'action_model', name: 'action_model'},
38+
{data: 'action_id', name: 'action_id'},
39+
{data: 'created_at', name: 'created_at'}
40+
]
41+
});
42+
</script>
43+
@stop

0 commit comments

Comments
 (0)