aboutsummaryrefslogtreecommitdiffhomepage
path: root/api/Posts/Models/MediaPost.php
diff options
context:
space:
mode:
authorMarvin Borner2018-08-24 16:19:39 +0200
committerMarvin Borner2018-08-24 16:19:39 +0200
commitadf07b310bddf751584db0717b8f501b8acda32a (patch)
treec0938cb059337e62c69a5a727dee4808e16cd2bc /api/Posts/Models/MediaPost.php
parent1362cdab92ffd8b8f375f42886e34a6674f2b5af (diff)
Added models for post types
Diffstat (limited to 'api/Posts/Models/MediaPost.php')
-rw-r--r--api/Posts/Models/MediaPost.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/api/Posts/Models/MediaPost.php b/api/Posts/Models/MediaPost.php
new file mode 100644
index 0000000..e6f1629
--- /dev/null
+++ b/api/Posts/Models/MediaPost.php
@@ -0,0 +1,28 @@
+<?php
+
+namespace Api\Posts\Models;
+
+use Laravel\Passport\HasApiTokens;
+use Illuminate\Notifications\Notifiable;
+use Illuminate\Database\Eloquent\Model;
+
+class MediaPost extends Model
+{
+ use HasApiTokens, Notifiable;
+
+ protected $table = "media_posts";
+
+ /**
+ * The attributes that are mass assignable.
+ *
+ * @var array
+ */
+ protected $fillable = [
+ 'description', 'media_path'
+ ];
+
+ public function post()
+ {
+ return $this->belongsTo('Api\Posts\Models\Post');
+ }
+}