PageRenderTime 27ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/app/Chatmessage.php

https://bitbucket.org/coredeveloper2013/navipi-test
PHP | 62 lines | 40 code | 4 blank | 18 comment | 0 complexity | 3cc7125629ebdc1c58e33b3c6f714500 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, LGPL-2.1
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Chatmessage extends Model
  5. {
  6. protected $table = 'chat_messages';
  7. /**
  8. * The attributes that are mass assignable.
  9. *
  10. * @var array
  11. */
  12. protected $fillable = [
  13. 'from_user_id',
  14. 'to_user_id',
  15. 'from_user_country_id',
  16. 'to_user_country_id',
  17. 'from_user_type',
  18. 'to_user_type',
  19. 'message',
  20. 'from_user_view_status',
  21. 'to_user_view_status',
  22. 'audio_status',
  23. 'type',
  24. 'file_name',
  25. 'file_ext',
  26. 'is_flirt',
  27. 'is_bot'
  28. ];
  29. /**
  30. * The attributes that should be hidden for arrays.
  31. *
  32. * @var array
  33. */
  34. public function fromUser()
  35. {
  36. return $this->belongsTo('App\User','from_user_id','id');
  37. }
  38. public function toUser()
  39. {
  40. return $this->belongsTo('App\User','to_user_id','id');
  41. }
  42. public function fromUserCountry()
  43. {
  44. return $this->belongsTo('App\Country','from_user_country_id','idCountry');
  45. }
  46. public function toUserCountry()
  47. {
  48. return $this->belongsTo('App\Country','to_user_country_id','idCountry');
  49. }
  50. /* public function fromUserChat()
  51. {
  52. return $this->belongsTo('App\Chatuser','from_user_id','from_user_id');
  53. }
  54. public function toUserChat()
  55. {
  56. return $this->belongsTo('App\Chatuser','to_user_id','to_user_id');
  57. } */
  58. }