Save workspace changes

This commit is contained in:
2026-04-18 17:02:56 +02:00
parent f02ea9a711
commit 87d60af5a9
4220 changed files with 1388603 additions and 1554 deletions

View File

@@ -0,0 +1,47 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class ProfileComment extends Model
{
protected $table = 'profile_comments';
protected $fillable = [
'profile_user_id',
'author_user_id',
'body',
'is_active',
];
protected $casts = [
'is_active' => 'boolean',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
/** Profile owner */
public function profileUser(): BelongsTo
{
return $this->belongsTo(User::class, 'profile_user_id');
}
/** Comment author */
public function author(): BelongsTo
{
return $this->belongsTo(User::class, 'author_user_id');
}
public function authorProfile(): BelongsTo
{
return $this->belongsTo(UserProfile::class, 'author_user_id', 'user_id');
}
/** Scope: only active (not removed) comments */
public function scopeActive($query)
{
return $query->where('is_active', true);
}
}