StatusHashtag.php 665 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. class StatusHashtag extends Model
  5. {
  6. public $fillable = [
  7. 'status_id',
  8. 'hashtag_id',
  9. 'profile_id',
  10. 'status_visibility'
  11. ];
  12. public function status()
  13. {
  14. return $this->belongsTo(Status::class);
  15. }
  16. public function hashtag()
  17. {
  18. return $this->belongsTo(Hashtag::class);
  19. }
  20. public function profile()
  21. {
  22. return $this->belongsTo(Profile::class);
  23. }
  24. public function media()
  25. {
  26. return $this->hasManyThrough(
  27. Media::class,
  28. Status::class,
  29. 'id',
  30. 'status_id',
  31. 'status_id',
  32. 'id'
  33. );
  34. }
  35. }