提交代码
This commit is contained in:
18
app/Models/Article.php
Normal file
18
app/Models/Article.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class Article extends Model
|
||||
{
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo(Category::class);
|
||||
}
|
||||
|
||||
public function getCoverPathAttribute()
|
||||
{
|
||||
return $this->cover ? env('APP_URL') . '/storage/' . $this->cover : '/assets/index/img/newImg_00_active.png';
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user