summaryrefslogtreecommitdiff
path: root/app/Http/Controllers/IndexController.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Http/Controllers/IndexController.php')
-rw-r--r--app/Http/Controllers/IndexController.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/app/Http/Controllers/IndexController.php b/app/Http/Controllers/IndexController.php
new file mode 100644
index 0000000..c77de48
--- /dev/null
+++ b/app/Http/Controllers/IndexController.php
@@ -0,0 +1,40 @@
+<?php
+
+namespace App\Http\Controllers;
+use Illuminate\Support\Facades\Cache;
+use Illuminate\Http\Request;
+
+use App\Libraries\AnimeSchedule;
+use App\Libraries\AnimeSeason;
+
+class IndexController extends Controller {
+ /**
+ * Shows the index page.
+ *
+ * @return Response
+ */
+ public function showPage() {
+
+ return view('index', [ ]);
+ }
+
+ #public function iCal(Request $request) {
+ public function iCal($username) {
+
+ if ( ! Cache::has('schedule_' . $username)) {
+ $userSchedule = new AnimeSchedule( $username );
+ $schedule = $userSchedule->getCalendar();
+ Cache::put('schedule_' . $username, $schedule, 360);
+ } else {
+ $schedule = Cache::get('schedule_' . $username);
+ }
+
+ header('Content-Type: text/calendar; charset=utf-8');
+ #var_dump($schedule);
+ echo $schedule;
+ }
+
+ public function test($param = null) {
+ $season = new AnimeSeason();
+ }
+}