ActivityLog.php 840 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace ModulesGarden\ProxmoxAddon\App\Models\Whmcs;
  3. use Illuminate\Database\Eloquent\Model as EloquentModel;
  4. /**
  5. * @property int $id
  6. * @property string $date
  7. * @property string $description
  8. * @property string $user
  9. * @property int $userid
  10. * @property string $ipaddr
  11. * @method static $this ofDescription($description)
  12. * @method $this today()
  13. */
  14. class ActivityLog extends EloquentModel
  15. {
  16. /** @var string */
  17. protected $table = 'tblactivitylog';
  18. protected $fillable = ['id', 'date', 'description', 'user', 'userid', 'ipaddr'];
  19. public function scopeOfDescription($query, $description)
  20. {
  21. return $query->where('description', $description);
  22. }
  23. public function scopeToday($query)
  24. {
  25. return $query->whereRaw(' TIMESTAMP(`date`) >= TIMESTAMP(NOW()- INTERVAL 1 DAY )');
  26. }
  27. }