dimanche 4 juillet 2021

How can i create auto suggestion search and page direction link information

public function searchlist(Request $request){
    $article = Article::latest('created_at')->paginate(5);
    $data['articles'] = $article;

    if($request->get('data')){
        $data = $request->get('data');
        $data = Article::select("title")->where('title','LIKE', "%{$data}%")->get();
        $output = '<ul class="dropdown-menu" style="display:block;width:100%; position:relative">';
        foreach ($data as $row) {
            $output .= '
        <li><a href=""  class="ml-2"  style="color:black;font-weight: bold;">' . $row->title . '</a></li>';
        }
        $output .= '</ul>';
        echo $output;
    }
}

Please tell me the how can add a page URL in the above code in a tag



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire