feat: harden tenant settings and import pipeline
This commit is contained in:
@@ -4,7 +4,9 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\{BelongsTo, HasMany, BelongsToMany};
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Event extends Model
|
||||
{
|
||||
@@ -13,9 +15,7 @@ class Event extends Model
|
||||
protected $table = 'events';
|
||||
protected $guarded = [];
|
||||
protected $casts = [
|
||||
'date' => 'date',
|
||||
'name' => 'array',
|
||||
'description' => 'array',
|
||||
'date' => 'datetime',
|
||||
'settings' => 'array',
|
||||
'is_active' => 'boolean',
|
||||
];
|
||||
@@ -39,5 +39,11 @@ class Event extends Model
|
||||
'task_collection_id'
|
||||
);
|
||||
}
|
||||
|
||||
public function tasks(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Task::class, 'event_task', 'event_id', 'task_id')
|
||||
->withTimestamps();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user