Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin committed Nov 14, 2024
1 parent 47efde6 commit a2dbf62
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions app/Console/Commands/SetupScout.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function handle(): void
*/
protected function scoutConfigure(): void
{
if (ScoutHelper::indexed()) {
if (ScoutHelper::isIndexed()) {
$this->artisan('☐ Updating indexes', 'scout:sync-index-settings', ['--verbose' => true]);
}
}
Expand All @@ -60,7 +60,7 @@ protected function scoutConfigure(): void
*/
protected function scoutFlush(): void
{
if ($this->option('flush') && ScoutHelper::indexed()) {
if ($this->option('flush') && ScoutHelper::isIndexed()) {
// Using meilisearch config for any driver
foreach (config('scout.meilisearch.index-settings') as $index => $settings) {
$name = (new $index)->getTable();
Expand All @@ -76,7 +76,7 @@ protected function scoutFlush(): void
*/
protected function scoutImport(): void
{
if ($this->option('import') && ScoutHelper::indexed()) {
if ($this->option('import') && ScoutHelper::isIndexed()) {
// Using meilisearch config for any driver
foreach (config('scout.meilisearch.index-settings') as $index => $settings) {
$name = (new $index)->getTable();
Expand Down
6 changes: 3 additions & 3 deletions app/Helpers/ScoutHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ScoutHelper
*
* @codeCoverageIgnore
*/
public static function activated(): bool
public static function isActivated(): bool
{
switch (config('scout.driver')) {
case 'algolia':
Expand All @@ -34,7 +34,7 @@ public static function activated(): bool
*
* @codeCoverageIgnore
*/
public static function indexed(): bool
public static function isIndexed(): bool
{
switch (config('scout.driver')) {
case 'algolia':
Expand All @@ -53,7 +53,7 @@ public static function indexed(): bool
*
* @codeCoverageIgnore
*/
public static function fullTextIndex(): bool
public static function isFullTextIndex(): bool
{
return config('scout.full_text_index') && in_array(DB::connection()->getDriverName(), ['mysql', 'pgsql']);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ protected static function boot(): void
*/
public function searchIndexShouldBeUpdated()
{
return ScoutHelper::activated();
return ScoutHelper::isActivated();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function toSearchableArray(): array
*/
public function searchIndexShouldBeUpdated()
{
return ScoutHelper::activated();
return ScoutHelper::isActivated();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Loan.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Loan extends Model
*/
public function searchIndexShouldBeUpdated()
{
return ScoutHelper::activated();
return ScoutHelper::isActivated();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Note.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function toSearchableArray(): array
*/
public function searchIndexShouldBeUpdated()
{
return ScoutHelper::activated();
return ScoutHelper::isActivated();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function up()

$table->index(['vault_id', 'id']);

if (ScoutHelper::fullTextIndex()) {
if (ScoutHelper::isFullTextIndex()) {
$table->fullText('first_name');
$table->fullText('last_name');
$table->fullText('middle_name');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function up()
$table->softDeletes();
$table->timestamps();

if (ScoutHelper::fullTextIndex()) {
if (ScoutHelper::isFullTextIndex()) {
$table->fullText('name');
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function up()
$table->text('body');
$table->timestamps();

if (ScoutHelper::fullTextIndex()) {
if (ScoutHelper::isFullTextIndex()) {
$table->fullText('title');
$table->fullText('body');
}
Expand Down

0 comments on commit a2dbf62

Please sign in to comment.