You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
I am experiencing an issue when using the enforceMorphMap method in my Laravel application. The package does not seem to respect the morph map defined in App\Providers\AppServiceProvider, which leads to incorrect queries being generated.
Steps to Reproduce:
Define a morph map in AppServiceProvider using Relation::enforceMorphMap:
use Illuminate\Database\Eloquent\Relations\Relation;
public function boot()
{
Relation::enforceMorphMap([
'amp' => 'App\Models\Amp',
// Other mappings
]);
}
Attempt to retrieve popular interactions using: $relations = InteractionRelation::popular('amp')->get();
The query generated looks for subject_type = 'App\Models\Amp' in the interactions table, instead of using the morph map key 'amp'.
Expected Behavior:
The package should respect the morph map and generate queries using the morph map key defined in enforceMorphMap, such as subject_type = 'amp'.
Actual Behavior:
The package generates queries using the fully qualified class name, ignoring the morph map, which results in incorrect query conditions.
Thank you for your attention to this matter. Please let me know if you need any more information or if there's anything I can do to assist in resolving this issue.
The text was updated successfully, but these errors were encountered:
Description:
I am experiencing an issue when using the enforceMorphMap method in my Laravel application. The package does not seem to respect the morph map defined in App\Providers\AppServiceProvider, which leads to incorrect queries being generated.
Steps to Reproduce:
Attempt to retrieve popular interactions using:
$relations = InteractionRelation::popular('amp')->get();
The query generated looks for subject_type = 'App\Models\Amp' in the interactions table, instead of using the morph map key 'amp'.
Expected Behavior:
The package should respect the morph map and generate queries using the morph map key defined in enforceMorphMap, such as subject_type = 'amp'.
Actual Behavior:
The package generates queries using the fully qualified class name, ignoring the morph map, which results in incorrect query conditions.
Additional Context:
Laravel Version: 11.36.1
Package Version: 3.6.1
PHP Version: 8.3.15
Thank you for your attention to this matter. Please let me know if you need any more information or if there's anything I can do to assist in resolving this issue.
The text was updated successfully, but these errors were encountered: