composer require yajra/laravel-datatables-oracle:~6.0
Open up config/app.php
and add the following in providers
key:
Yajra\Datatables\DatatablesServiceProvider::class,
Then run the following:
php artisan vendor:publish --tag=datatables
$ php artisan tinker
>>> factory(App\User::class, 100)->create();
Route::get('/users', 'DatatablesController@index');
Route::any('/data', 'DatatablesController@anyData')->name('datatables.data');
@extends('layouts.app')
@section('styles')
<link rel="stylesheet" href="//cdn.datatables.net/1.10.7/css/jquery.dataTables.min.css">
@endsection
@section('scripts')
<script src="//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script>
<script>
$(function() {
$('#users-table').DataTable({
processing: true,
serverSide: true,
ajax: '{!! route('datatables.data') !!}',
columns: [
{ data: 'id', name: 'id' },
{ data: 'name', name: 'name' },
{ data: 'email', name: 'email' },
{ data: 'created_at', name: 'created_at' },
{ data: 'updated_at', name: 'updated_at' }
]
});
});
</script>
@endsection
@section('content')
<div class="container">
<div class="panel panel-default">
<div class="panel-body">
<table class="table table-bordered" id="users-table">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Email</th>
<th>Created At</th>
<th>Updated At</th>
</tr>
</thead> </table>
</div>
</div>
</div>
@stop
controller ???