I have a function in helper.php:
public static function getFristImageSearch($slug)
{
$slug = str_replace("-", " ", $slug);
$image = Images::select('thumbnail')->where( 'metakeywords','LIKE', '%'.$slug.'%' )
->where('status', 'active' )
->groupBy('id')
->orderBy('DATE', 'desc' )
->first();
if( isset( $image ) ) {
return $image->thumbnail;
}
else
{
return "";
}
}
now I want to call this function in Javascript abc.js:
var n = e.replace(t, "<b>" + myvariable + "</b>");
var gotme = getFristImageSearch(n);
but variable gotme doesnot work
getFristImageSearch is not defined
routename methodAJAX