You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
622 B
33 lines
622 B
5 years ago
|
<?php
|
||
|
|
||
|
namespace App;
|
||
|
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
||
|
class Post extends Model
|
||
|
{
|
||
|
|
||
|
// auther changed to author.
|
||
|
protected $fillable = ['text','author_id','business_item_id','product_id'];
|
||
|
|
||
|
|
||
|
public function author ()
|
||
|
{
|
||
|
return $this->belongsTo('App\User');
|
||
|
}
|
||
|
public function business_item ()
|
||
|
{
|
||
|
return $this->belongsTo('App\BusinessItem');
|
||
|
}
|
||
|
public function product ()
|
||
|
{
|
||
|
return $this->belongsTo('App\Product');
|
||
|
}
|
||
|
public function user_frames()
|
||
|
{
|
||
|
return $this->morphToMany('App\\SpUserFrame', 'element', 'sp_user_elements');
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|