Activity.php 389 B

123456789101112131415161718192021
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Activity extends Model
  5. {
  6. protected $dates = ['processed_at'];
  7. protected $fillable = ['data', 'to_id', 'from_id', 'object_type'];
  8. public function toProfile()
  9. {
  10. return $this->belongsTo(Profile::class, 'to_id');
  11. }
  12. public function fromProfile()
  13. {
  14. return $this->belongsTo(Profile::class, 'from_id');
  15. }
  16. }