Torann / laravel-cloudsearch

Index and search Laravel models on Amazon's CloudSearch
BSD 2-Clause "Simplified" License
22 stars 10 forks source link

Support specific model #6

Open CasperLaiTW opened 6 years ago

CasperLaiTW commented 6 years ago

Problem:

The config only support 1 namespace, and in my project, I have 2 namespaces for models.

  1. App
  2. Applications\Models

config was setup model namespace = \\App, so mean I can't switch to other namespace.

Solution:

Get full namespace(specific model), mean no need to using config model namespace.

Hope this PR can solve specific model issues

Command:

php artisan Media,\\Applications\\Models\\Media,Models\\Media

Get Model array is

array:2 [
  0 => "\App\Media"
  1 => "\Applications\Models\Media"
  2 => "\App\Models\Media"
]