调整页面

This commit is contained in:
2020-09-15 14:01:28 +08:00
parent 3ac390f68f
commit f91a3b76c1
20 changed files with 5068 additions and 642 deletions

View File

@@ -7,8 +7,14 @@ use App\Models\Traits\HasOneCover;
class Article extends Model
{
use HasOneCover, BelongsToCategory;
public function getLinkAttribute()
{
return route('article.show', $this);
}
public function get_content_cover()
{
preg_match("/<img.*?src=\"([^\"]+)\"[^>].*?>/isU", str_ireplace("\\", "", $this->content), $matches);
@@ -41,6 +47,7 @@ class Article extends Model
}
}
return $path;
}