Files
2026-09-01 09:22:30 -03:00

49 lines
990 B
PHP
Executable File

<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class CookieConsent extends Model
{
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'user_id',
'session_id',
'ip_address',
'user_agent',
'consents',
'accepted_at',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'consents' => 'array',
'accepted_at' => 'datetime',
];
}
/**
* Get the user that owns the cookie consent.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<\App\Models\User, \App\Models\CookieConsent>
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}