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);
}