This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/app/Controllers/Manage/OverviewController.php
2016-08-05 04:35:37 +02:00

52 lines
986 B
PHP

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