First Commit

This commit is contained in:
marco
2026-09-01 07:49:48 -03:00
commit 28b1044038
399 changed files with 41659 additions and 0 deletions
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* @property int $id
* @property int|null $user_id
* @property string $name
* @property string|null $description
* @property string|null $introduction
* @property bool $is_system
* @property bool $is_active
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read User|null $user
* @property-read Collection<int, UserSubject> $userSubjects
* @property-read Collection<int, Insight> $insights
*/
class Subject extends Model
{
/** @var array<int, string> */
protected $fillable = [
'user_id',
'name',
'description',
'introduction',
'message_type',
'custom_instructions',
'is_system',
'is_active',
];
/** @var array<string, string> */
protected $casts = [
'is_system' => 'boolean',
'is_active' => 'boolean',
];
/**
* Get the user who created the subject.
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* Get the user subjects associated with this subject.
*/
public function userSubjects(): HasMany
{
return $this->hasMany(UserSubject::class);
}
/**
* Get the insights associated with this subject.
*/
public function insights(): HasMany
{
return $this->hasMany(Insight::class);
}
}