mikebronner / laravel-model-caching

Eloquent model-caching made easy.
MIT License
2.22k stars 212 forks source link

Conflict with Spatie Schemaless #460

Open n3storm opened 3 months ago

n3storm commented 3 months ago

Describe the bug ErrorException when using with Spatie Schemaless

This is due to trait ModelCaching also defines __get function as SchemalessAttributes on line 51

https://github.com/spatie/laravel-schemaless-attributes/blob/main/src/SchemalessAttributes.php#L51

Stack Trace

  Trait method GeneaLabs\LaravelModelCaching\Traits\Cachable::__get has not been applied as Modules\Dossiers\Models\Dossier::__get, because of collision with Spatie\SchemalessAttributes\SchemalessAttributesTrait::__get

  at Modules/Dossiers/Models/Dossier.php:40
     36▕ use Venturecraft\Revisionable\RevisionableTrait;
     37▕ use Wildside\Userstamps\Userstamps;
     38▕ use GeneaLabs\LaravelModelCaching\Traits\Cachable;
     39▕ 
  ➜  40▕ class Dossier extends Model implements HasMedia, PresentableInterface
     41▕ {
     42▕     use Archivable;
     43▕     use BaseModelContract;
     44▕     use Filterable;

      +1 vendor frames 

  2   [internal]:0

Environment

Additional context Not sure if this is solvable. Please add to Possible Package Conflicts documentation section.