@@ -2,7 +2,9 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Calendar\Month;
|
||||
use App\Post;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class StatsController extends Controller
|
||||
{
|
||||
@@ -11,4 +13,22 @@ class StatsController extends Controller
|
||||
// TODO
|
||||
exit;
|
||||
}
|
||||
|
||||
public function calendar($type, $year = null, $month = null)
|
||||
{
|
||||
if (null === $month) {
|
||||
$month = date('m');
|
||||
}
|
||||
|
||||
if (null === $year) {
|
||||
$year = date('Y');
|
||||
}
|
||||
|
||||
$posts = Post::getUserPostForMonth(Auth::user()->getAuthIdentifier(), $year, $month);
|
||||
|
||||
if ('month' === $type) {
|
||||
$month_calendar = new Month($year, $month, $posts);
|
||||
return view('stats.calendar', ['month' => $month_calendar, 'type' => $type]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user