-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to locate Squire source for [App\Models\Country] #16
Comments
Hey, I cannot replicate this. Please provide a repo where I can, and I will happily reopen this issue. Thanks! |
I face the same issue as @ShamarKellman and I solved it by re-registering sources:
<?php
namespace App\Providers;
use App\Models\Country;
use Squire\Repository;
use Illuminate\Support\ServiceProvider;
class SquireServiceProvider extends ServiceProvider
{
public function boot()
{
Repository::registerSource(Country::class, 'ar', resource_path('/squire-data/countries-ar.csv'));
Repository::registerSource(Country::class, 'fr', base_path('/vendor/squirephp/countries-fr/resources/data.csv'));
Repository::registerSource(Country::class, 'en', base_path('/vendor/squirephp/countries-en/resources/data.csv'));
}
} and
<?php
return [
// ...
'providers' => [
// ...
App\Providers\SquireServiceProvider::class,
],
// ...
]; |
Ah interesting. I see why this is a bug now. Because the sources are registered to the base class and not the original class, it can't find them. I'm going to think of a good way to fix this. |
I have the same issue |
1 similar comment
I have the same issue |
@danharrin - Probably the easiest way to come about this is to refactor the models to require a static We could always check if the name is an existing class and then recurse its parents, that just seems like too much going on though. |
Describe the bug
Unable to find source when using extended Country model.
To reproduce
Call
Expected behavior
Expected to show all countries
Context
Additional details
Add any other details about the problem here.
The text was updated successfully, but these errors were encountered: