AccountInterstitial.php 560 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. class AccountInterstitial extends Model
  5. {
  6. /**
  7. * The attributes that should be mutated to dates.
  8. *
  9. * @var array
  10. */
  11. protected $casts = [
  12. 'read_at' => 'datetime',
  13. 'appeal_requested_at' => 'datetime'
  14. ];
  15. public const JSON_MESSAGE = 'Please use web browser to proceed.';
  16. public function user()
  17. {
  18. return $this->belongsTo(User::class);
  19. }
  20. public function status()
  21. {
  22. if($this->item_type != 'App\Status') {
  23. return;
  24. }
  25. return $this->hasOne(Status::class, 'id', 'item_id');
  26. }
  27. }