blob: 321c38cc64aaf58d61fabef5334e914ba644be65 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
<?php
namespace Api\Posts\Models;
use Laravel\Passport\HasApiTokens;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
use HasApiTokens, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'post_types_id', 'user_id'
];
public function user()
{
return $this->belongsTo('Api\Users\Models\User');
}
public function post_type()
{
return $this->belongsTo('Api\Posts\Models\Post');
}
public function media_post()
{
return $this->hasOne('Api\Posts\Models\MediaPost');
}
public function text_post()
{
return $this->hasOne('Api\Posts\Models\TextPost');
}
}
|