Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
Use a Laravel branch agnostic method for finding the application name…
Browse files Browse the repository at this point in the history
…space. This makes the package Laravel 5.3 and 5.4 compatible.
  • Loading branch information
ChrisThompsonTLDR committed May 4, 2017
1 parent 46feb29 commit be56dd9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Services/IndexService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

namespace DamianTW\MySQLScout\Services;

use Illuminate\Console\DetectsApplicationNamespace;
use Laravel\Scout\Searchable;
use Illuminate\Support\Facades\DB;
use DamianTW\MySQLScout\Events;
use Illuminate\Container\Container;

class IndexService
{
use DetectsApplicationNamespace;

protected $modelService;

public function __construct(ModelService $modelService)
Expand Down Expand Up @@ -112,6 +110,11 @@ protected function getIndexFields()
return $indexFields;
}

public function getAppNamespace()
{
return Container::getInstance()->getNamespace();
}

protected function updateIndex()
{
$this->dropIndex();
Expand Down

1 comment on commit be56dd9

@DMeganoski
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.