Created
April 15, 2019 09:43
-
-
Save nunomaduro/37dbebff93a6da65928ff57fa7d14f1a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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