Initialize repo and add session changes (2025-09-08)
This commit is contained in:
27
app/Models/Task.php
Normal file
27
app/Models/Task.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Task extends Model
|
||||
{
|
||||
protected $table = 'tasks';
|
||||
protected $guarded = [];
|
||||
protected $casts = [
|
||||
'title' => 'array',
|
||||
'description' => 'array',
|
||||
'example_text' => 'array',
|
||||
];
|
||||
|
||||
public function emotion(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Emotion::class);
|
||||
}
|
||||
|
||||
public function eventType(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(EventType::class, 'event_type_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user