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

49
app/Models/OnlineHelp.php Normal file
View File

@@ -0,0 +1,49 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class OnlineHelp extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'title_english',
'title_chinese',
'details_english',
'details_chinese',
'category',
'sort',
];
public function getTitleAttribute()
{
if (strtolower(app()->getLocale()) == 'zh_hk') {
return $this->title_chinese;
}
return $this->title_english;
}
public function getDetailsAttribute()
{
if (strtolower(app()->getLocale()) == 'zh_hk') {
return $this->detailss_chinese;
}
return $this->detailss_english;
}
public function getCategoryNameDisplayAttribute()
{
if ($this->category == 'faq') {
return __("FAQ");
}
return __("Online Documents");
}
}