Notification.php 715 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Illuminate\Database\Eloquent\SoftDeletes;
  6. class Notification extends Model
  7. {
  8. use HasFactory, SoftDeletes;
  9. protected $fillable = [
  10. 'title',
  11. 'description',
  12. 'origin',
  13. 'origin_id',
  14. 'type',
  15. 'read',
  16. 'read_at',
  17. 'user_id',
  18. ];
  19. protected $casts = [
  20. 'read' => 'boolean',
  21. 'read_at' => 'datetime',
  22. 'created_at' => 'datetime',
  23. 'updated_at' => 'datetime',
  24. 'deleted_at' => 'datetime',
  25. ];
  26. public function user()
  27. {
  28. return $this->belongsTo(User::class);
  29. }
  30. }