Skip to content

Commit

Permalink
working on datatables
Browse files Browse the repository at this point in the history
  • Loading branch information
Halim authored and Halim committed Nov 8, 2016
1 parent 102b32f commit 3710444
Show file tree
Hide file tree
Showing 27 changed files with 3,177 additions and 64 deletions.
34 changes: 32 additions & 2 deletions app/Http/Controllers/Articles2Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,55 @@
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Yajra\Datatables;

class Articles2Controller extends Controller {
/*
*
*/

public function __construct() {
$this->middleware('auth');
$this->middleware('auth');
}

/**
* Display a listing of the resource.
*
* @return Response
* Documentation:
* https://datatables.yajrabox.com/starter#migrate-seed
* https://github.com/yajra/laravel-datatables
* http://yajra.github.io/laravel-datatables/
*/
public function index() {


return view('articles2.index');
}

/**
* Process datatables ajax request.
*
* @return \Illuminate\Http\JsonResponse
*/
public function data() {

//
//return Datatables::of(\App\Article::query())->make(true);
return Datatables::queryBuilder(DB::table('articles'))->make(true);

// Using Eloquent
// return Datatables::eloquent(User::query())->make(true);

// Using Query Builder
// return Datatables::queryBuilder(DB::table('users'))->make(true);

// Using Collection
// return Datatables::collection(User::all())->make(true);

// Using the Engine Factory
// return Datatables::of(User::query())->make(true);
// return Datatables::of(DB::table('users'))->make(true);
// return Datatables::of(User::all())->make(true);
}

}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function login00000() {
public function authenticated($request, $user) {

//flash('Welcome back ' . $user->username . ', you have been logged in');
flash()->overlay('Welcome back ' . $user->username . ', you have been logged in');
flash()->overlay('Welcome back ' . $user->username . ', you have been logged in', 'Welcome');

}

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"php": ">=5.6.4",
"laravel/framework": "5.3.*",
"laravelcollective/html": "5.3.*",
"laracasts/flash": "^2.0"
"laracasts/flash": "^2.0",
"yajra/laravel-datatables-oracle": "^6.21"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
Expand Down
Loading

0 comments on commit 3710444

Please sign in to comment.