| Total Complexity | 5 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class FaqArticle extends Model |
||
| 17 | { |
||
| 18 | protected $table = 'faq_articles'; |
||
| 19 | |||
| 20 | protected $fillable = [ |
||
| 21 | 'category_id', 'admin_id', 'title', 'content', |
||
| 22 | ]; |
||
| 23 | |||
| 24 | protected $appends = [ |
||
| 25 | 'edit_url', 'destroy_url', |
||
| 26 | ]; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
| 30 | */ |
||
| 31 | public function category() |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
| 38 | */ |
||
| 39 | public function admin() |
||
| 40 | { |
||
| 41 | return $this->belongsTo(Administrator::class, 'admin_id'); |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return string |
||
| 46 | */ |
||
| 47 | public function getEditUrlAttribute() |
||
| 48 | { |
||
| 49 | return route('backend.faq.article.edit', $this); |
||
|
|
|||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | public function getDestroyUrlAttribute() |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @return string |
||
| 62 | */ |
||
| 63 | public function getContent() |
||
| 68 |