NotificationSend.php 561 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  5. class NotificationSend extends Model
  6. {
  7. protected $guarded = ['id'];
  8. protected function casts(): array
  9. {
  10. return [
  11. 'read' => 'boolean',
  12. 'read_at' => 'datetime',
  13. ];
  14. }
  15. public function notification(): BelongsTo
  16. {
  17. return $this->belongsTo(Notification::class);
  18. }
  19. public function user(): BelongsTo
  20. {
  21. return $this->belongsTo(User::class);
  22. }
  23. }