0
我正在寻找一些代码示例,使关键字从邮政进入内部链接。Laravel内部链接
在职位表我有身体属性在哪里是文章的文章。而我做额外的表“关键字”在哪里是单词和URL属性。
所以我需要脚本,它会自动识别添加在表格“关键字”中的单词,并在帖子文本中找到此单词并将此单词变为超链接。你们能帮我吗?
use App\Post;
use App\Category;
use App\Keyword;
public function getSingle($slug) {
// fetch from the DB based on slug
$categoriesall = Category::all();
$post = Post::where('slug', '=', $slug)->first();
// return the view and pass in the post object
return view('news.single')->withPost($post)->withCategoriesall($categoriesall);
}