public function getStumanage()
 {
     $pages = StudentManageLog::where("review", false)->first();
     if ($pages) {
         $pages = StudentManageLog::orderBy('review', 'asc')->orderBy('created_at', 'asc')->paginate(15);
     } else {
         $pages = StudentManageLog::orderBy('review', 'asc')->orderBy('created_at', 'desc')->paginate(15);
     }
     return view('log.stumanage')->withPages($pages);
     //$pages = StudentManageLog::where("review", false)->orderBy('created_at', 'desc')->orWhere("review", true)->orderBy("created_at", "asc")->paginate(15);
 }
 function getModifyitems(Request $request)
 {
     $students = StudentManageLog::where('review', 0)->get();
     $r_arr = array();
     foreach ($students as $item) {
         $arr = array();
         $before = json_decode($item->before_info, true);
         $after = json_decode($item->after_info, true);
         $arr['diff'] = array_diff_assoc($before, $after);
         $arr['id'] = $after['id'];
         $r_arr[] = $arr;
     }
     return json_encode($r_arr);
 }
    Route::get('/home', function () {
        return view('home');
    });

    Route::controllers([
        'changepassword' => 'Auth\ChangePasswordController',
        'log' => 'LogController',
        'studentview' => 'StudentViewController',
    ]);
});

Route::group(['middleware' => 'admin'], function () {
    Route::controllers([
        'usermanage' => 'UserManageController',
        'studentmanage' => 'StudentManageController',
    ]);
});
*/
use App\StudentManageLog;
use App\File;
Route::get('/', function () {
    $pages = StudentManageLog::where("review", "0")->orderBy('created_at', 'desc')->paginate(15);
    $files = File::orderBy('updated_at', 'desc')->take(15)->get();
    return view('home')->withPages($pages)->withFiles($files);
});
Route::get('/home', function () {
    $pages = StudentManageLog::where("review", "0")->orderBy('created_at', 'desc')->paginate(15);
    $files = File::orderBy('updated_at', 'desc')->take(15)->get();
    return view('home')->withPages($pages)->withFiles($files);
});
Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController', 'changepassword' => 'Auth\\ChangePasswordController', 'log' => 'LogController', 'studentview' => 'StudentViewController', 'usermanage' => 'UserManageController', 'studentmanage' => 'StudentManageController', 'countrymanage' => 'CountryManageController', 'excel' => 'PHPExcelController', 'tuition' => 'TuitionController', 'file' => 'FileManageController', 'statistic' => 'StatisticController', 'generate' => 'GenerateTableController', 'graduate' => 'GraduateController']);
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     $count = StudentManageLog::where('review', 0)->count();
     view()->share('logs_count', $count);
 }