/** * Get all the user stats on user login/logout * @param Request $request Htttp Get * @return JSon response All the stats */ function getStats(Request $request) { $allowed_columns = ['last_login', 'ip']; $sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'user_id'; $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; $stats = Stat::orderBy($sort, $order)->get(); return response()->json($stats)->setCallback($request->input('callback')); }
public function index(Request $request) { $startdate = Stat::dateFormat($request->input('startdate')); $enddate = Stat::dateFormat($request->input('enddate')); // if (!empty($request->input('sprint'))) { // $sprint = Sprint::where('sprint', $request->input('sprint'))->first(); // if (count($sprint)) { // $startdate = $sprint->start; // $enddate = $sprint->end; // } // } $stat = Stat::orderBy('updated_at')->whereDate('updated_at', '>=', $startdate)->whereDate('updated_at', '<=', $enddate)->get(); return view('report')->with('stat', $stat)->with('startdate', $startdate)->with('enddate', $enddate)->with('sprint', $request->input('sprint')); }
/** * Show the application dashboard. * * @return \Illuminate\Http\Response */ public function index() { $stats = Stat::orderBy('published_at', 'desc')->get(); return view('home', compact('stats')); }