|
|
@ -6,11 +6,20 @@ namespace App\Http\Controllers; |
|
|
|
|
|
|
|
|
|
|
|
use App\Models\Table; |
|
|
|
use App\Models\Table; |
|
|
|
use App\Models\User; |
|
|
|
use App\Models\User; |
|
|
|
|
|
|
|
use Illuminate\Http\Request; |
|
|
|
|
|
|
|
use MightyPork\Utils\Utils; |
|
|
|
|
|
|
|
|
|
|
|
class DashController extends Controller |
|
|
|
class DashController extends Controller |
|
|
|
{ |
|
|
|
{ |
|
|
|
public function view() |
|
|
|
public function view(Request $request) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
$dismiss = false; |
|
|
|
|
|
|
|
if ($request->has('dismiss-greeter')) { |
|
|
|
|
|
|
|
$dismiss = Utils::parseBool01($request->get('dismiss-greeter')); |
|
|
|
|
|
|
|
\Cookie::queue('dismiss-greeter', $dismiss); |
|
|
|
|
|
|
|
return back(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$users = User::orderBy('updated_at', 'desc') |
|
|
|
$users = User::orderBy('updated_at', 'desc') |
|
|
|
->paginate(15, ['id', 'title', 'name'], 'pageu'); |
|
|
|
->paginate(15, ['id', 'title', 'name'], 'pageu'); |
|
|
|
|
|
|
|
|
|
|
@ -19,6 +28,8 @@ class DashController extends Controller |
|
|
|
->orderBy('visits', 'desc') |
|
|
|
->orderBy('visits', 'desc') |
|
|
|
->paginate(10, ['*'], 'paget'); |
|
|
|
->paginate(10, ['*'], 'paget'); |
|
|
|
|
|
|
|
|
|
|
|
return view('welcome', compact('users', 'tables')); |
|
|
|
$showGreeter = !$dismiss && !$request->cookie('dismiss-greeter', false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return view('welcome', compact('users', 'tables', 'showGreeter')); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|