first commit

This commit is contained in:
benjibennn
2023-12-22 12:35:55 +08:00
commit 9f89a732d6
872 changed files with 156291 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ServiceChat extends Model
{
use HasFactory;
public const PATH_PREFIX = 'public/chats';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'company_id',
'user_id',
'service_type',
];
public function messages()
{
return $this->hasMany(ServiceChatMessage::class);
}
public function user()
{
return $this->belongsTo(User::class);
}
public function company()
{
return $this->belongsTo(Company::class);
}
public function getFolderPathAttribute()
{
return self::PATH_PREFIX . '/' . $this->id;
}
}