<?php
/**
* Holds the overview controller.
* @package Sakura
*/
namespace Sakura\Controllers\Manage;
use Sakura\DB;
* Overview controller.
* @author Julian van de Groep <me@flash.moe>
class OverviewController extends Controller
{
* Renders the base overview page.
* @return string
public function index(): string
return view('manage/overview/index');
}
* Gets the data for the overview page.
public function data(): string
$data = new \stdClass;
$data->postsCount = DB::table('posts')
->count();
$data->topicsCount = DB::table('topics')
$data->usersCount = DB::table('users')
$data->commentsCount = DB::table('comments')
$data->uploadsCount = DB::table('uploads')
return $this->json($data);