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

Commit be56dd9

Browse files
Use a Laravel branch agnostic method for finding the application namespace. This makes the package Laravel 5.3 and 5.4 compatible.
1 parent 46feb29 commit be56dd9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Services/IndexService.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22

33
namespace DamianTW\MySQLScout\Services;
44

5-
use Illuminate\Console\DetectsApplicationNamespace;
65
use Laravel\Scout\Searchable;
76
use Illuminate\Support\Facades\DB;
87
use DamianTW\MySQLScout\Events;
8+
use Illuminate\Container\Container;
99

1010
class IndexService
1111
{
12-
use DetectsApplicationNamespace;
13-
1412
protected $modelService;
1513

1614
public function __construct(ModelService $modelService)
@@ -112,6 +110,11 @@ protected function getIndexFields()
112110
return $indexFields;
113111
}
114112

113+
public function getAppNamespace()
114+
{
115+
return Container::getInstance()->getNamespace();
116+
}
117+
115118
protected function updateIndex()
116119
{
117120
$this->dropIndex();

0 commit comments

Comments
 (0)