Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Users
- --id
- --username
- --Posts
- --id
- --summary
- --published
- --Images
- --id
- --link
- --alt
- --image_id
- --image_type
- public function scopeWithImages()
- {
- return static::with('images')->get();
- }
- public function images()
- {
- return $this->morphMany('AppModelsImages', 'image');
- }
- public function scopeWithImages()
- {
- return static::with('images')->get();
- }
- public function images()
- {
- return $this->morphMany('AppModelsImages', 'image');
- }
- public function users()
- {
- return $this->morphedByMany('AppModelsUsers', 'image');
- }
- public function posts()
- {
- return $this->morphedByMany('AppModelsPosts', 'image');
- }
Add Comment
Please, Sign In to add comment