summaryrefslogtreecommitdiff
path: root/app/Calendar.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Calendar.php')
-rw-r--r--app/Calendar.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/app/Calendar.php b/app/Calendar.php
new file mode 100644
index 0000000..a42e190
--- /dev/null
+++ b/app/Calendar.php
@@ -0,0 +1,33 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Calendar extends Model
+{
+ protected $table = 'calendar';
+
+ protected $fillable = [
+ 'mal_id',
+ 'user_id',
+ 'airing_at',
+ 'duration',
+ 'episode',
+ 'episode_watched',
+ 'episode_complete',
+ 'score',
+ 'score_user',
+ ];
+
+ public function __construct() {
+ }
+
+ public function user() {
+ return $this->belongsTo('App\MALUser', 'user_id', 'id');
+ }
+
+ public function anime() {
+ return $this->belongsTo('App\Anime', 'mal_id', 'mal_id');
+ }
+}