🆙 Add fixed cms 🆙
This commit is contained in:
1 parent
b1a2cab62d
commit
b67e0ec2b9
3982 files changed
+193682
No files matched your search
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Help;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Stevebauman\Purify\Facades\Purify;
|
||||
|
||||
class WebsiteHelpCenterTicketReply extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
public function ticket(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(WebsiteHelpCenterTicket::class, 'ticket_id');
|
||||
}
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
public function canDeleteReply()
|
||||
{
|
||||
return $this->user_id === Auth::id() || hasPermission('delete_website_ticket_replies');
|
||||
}
|
||||
|
||||
public function getContentAttribute($value)
|
||||
{
|
||||
return Purify::clean($value);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user