File tree Expand file tree Collapse file tree 2 files changed +67
-0
lines changed Expand file tree Collapse file tree 2 files changed +67
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments