Skip to content
Driver for Laravel Scout database search package based
PHP
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
database/migrations
src
tests
.gitignore
LICENSE
README.md
composer.json
phpunit.xml

README.md

About APSearch Scout Driver

Laravel Scout Driver based on database search

...

How to...

Requires:

1: First, you may use Composer to install APSearch as a required dependency into your Laravel project:

composer require AdrianoPedro/laravel-scout-database-driver

2: Then, you have to publish the database migration into your Laravel project:

php artisan vendor:publish --tag=apsearch-migrations

3: Now, you have to migrate the database migration into your Laravel project:

php artisan migrate --path=/database/migrations/create_searchables_table.php

5: Update your .env and config/scout.php files to set scout driver to apsearch:

.env

	SCOUT_DRIVER = apsearch
	SCOUT_QUEUE  = true //for queueing the process, if false it will be processed emmidiatly uppon creation/update/delete

config/scout.php

//...
'algolia' => [
	'id' => env('ALGOLIA_APP_ID', ''),
	'secret' => env('ALGOLIA_SECRET', ''),
],
//...
'apsearch' => [
	//
],
//...

5: Add apSearchScoutServiceProvider the providers list on your projects config/app.php:

<?php

return [
    //...
    'providers' => [
        //...
        Laravel\Scout\ScoutServiceProvider::class,
        AdrianoPedro\Scout\APSearchScoutServiceProvider::class,
    ],
    //...
];      

6: Include Scout class on the models you want to implement Searchable:

<?php

namespace App\Model;

//..
use Laravel\Scout\Searchable;


class Model extends Model
{
    //..
    use Searchable;

7: Optionally, you can import existing models (using Scout Searchable):

php artisan apsearch:import Path\\To\\Model

License

APSearch is an open-sourced software licensed under the MIT license.

You can’t perform that action at this time.