Skip to content

Instantly share code, notes, and snippets.

@nunomaduro
Created April 15, 2019 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nunomaduro/37dbebff93a6da65928ff57fa7d14f1a to your computer and use it in GitHub Desktop.
Save nunomaduro/37dbebff93a6da65928ff57fa7d14f1a to your computer and use it in GitHub Desktop.
<div class="content">
<div class="title m-b-md">
Laravel
</div>
<div id="app">
<!-- In a default Laravel app, Vue will render inside an #app div -->
<ais-instant-search
:search-client="searchClient"
index-name="{{ (new App\User)->searchableAs() }}"
>
<ais-search-box placeholder="Search users..."></ais-search-box>
<ais-hits>
<template slot="item" slot-scope="{ item }">
<div>
<h1>@{{ item.title }}</h1>
<h4>@{{ item.summary }}</h4>
</div>
</template>
</ais-hits>
</ais-instant-search>
</div>
<script src="{{ mix('js/app.js') }}"></script>
<script>
new Vue({
data: function() {
return {
searchClient: algoliasearch(
'{{ config('scout.algolia.id') }}',
'{{ Algolia\ScoutExtended\Facades\Algolia::searchKey(App\User::class) }}',
),
};
},
el: '#app',
});
</script>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment