https://github.com/typesense/user-admin-search-laravel-demo
A demo Laravel app that integrates with Typesense
https://github.com/typesense/user-admin-search-laravel-demo
laravel laravel-scout typesense
Last synced: 5 months ago
JSON representation
A demo Laravel app that integrates with Typesense
- Host: GitHub
- URL: https://github.com/typesense/user-admin-search-laravel-demo
- Owner: typesense
- Created: 2024-01-12T16:56:51.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-17T01:11:24.000Z (over 1 year ago)
- Last Synced: 2024-12-23T08:03:40.256Z (5 months ago)
- Topics: laravel, laravel-scout, typesense
- Language: PHP
- Homepage:
- Size: 88.9 KB
- Stars: 6
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Typesense Search with Laravel
This sample application shows you how to use Laravel Scout's native integration with Typesense.
We use a sample dataset with 10K user records, show you how to search through the dataset.
## Installation
Install composer dependencies
```bash
composer install
```
Create .env file
```bash
cp .env.example .env
```
Generate APP_KEY
```bash
php artisan key:generate
```Start Typesense:
```bash
export TYPESENSE_API_KEY=xyzmkdir $(pwd)/typesense-data
docker run -p 8108:8108 \
-v$(pwd)/typesense-data:/data typesense/typesense:0.25.2 \
--data-dir /data \
--api-key=$TYPESENSE_API_KEY \
--enable-cors
```Migrate the databases and seed the testing data.
Create the database if not created in prompt. We use SQLite.
```bash
php artisan migrate --seed
```Install node dependencies and build the frontend.
```bash
npm install
```
```bash
npm run build
```## Run the App
```bash
php artisan serve
```Visit [http://127.0.0.1:8000](http://127.0.0.1:8000) to see the app.
## Documentation
Read more about how to use Laravel Scout with Typesense here: [https://laravel.com/docs/10.x/scout#typesense](https://laravel.com/docs/10.x/scout#typesense).