inital commit
This commit is contained in:
37
app/Models/Support_Reply.php
Normal file
37
app/Models/Support_Reply.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class Support_Reply extends BaseModel
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'support_replies';
|
||||
protected $fillable = ['support_id','message','sender_id','attachment_path','is_read'];
|
||||
|
||||
public function addSupportReply($inputData){
|
||||
|
||||
$return_data = self::create($inputData);
|
||||
return $return_data;
|
||||
}
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\User');
|
||||
}
|
||||
|
||||
public function getSupportById($supportId)
|
||||
{
|
||||
return self::where(['support_id'=>$supportId])->get();
|
||||
}
|
||||
|
||||
public function updateSupportReply($inputData)
|
||||
{
|
||||
return self::where([['sender_id', '!=',$inputData['sender_id']],'support_id'=> $inputData['support_id'], 'is_read' => 0])->update(['is_read' => 1]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user