29 lines
558 B
PHP
29 lines
558 B
PHP
<?php
|
|
|
|
namespace Modules\ManagementTools\Entities;
|
|
|
|
use App\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class MtUserTicketReply extends Model
|
|
{
|
|
protected $table = 'mt_user_ticket_replies';
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
public function ticket()
|
|
{
|
|
return $this->belongsTo(MtUserTicket::class, 'ticket_id');
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function scopeForBusiness($query, $business_id)
|
|
{
|
|
return $query->where('business_id', $business_id);
|
|
}
|
|
}
|