mirror of
https://gh.wpcy.net/https://github.com/fairpm/aspirecloud.git
synced 2026-06-20 02:22:28 +08:00
18 lines
416 B
PHP
18 lines
416 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models\Traits;
|
|
|
|
use App\Observers\ElasticSearchObserver;
|
|
|
|
/**
|
|
* @method static observe(string $class)
|
|
*/
|
|
trait Indexable
|
|
{
|
|
public static function bootIndexable(): void
|
|
{
|
|
// @phpstan-ignore-next-line (my disgust for Laravel's __magic knows no bounds)
|
|
config('elasticsearch.auto_index') and static::observe(ElasticSearchObserver::class);
|
|
}
|
|
}
|