Skip to content

SQLite does not support whereNotMorphedTo #57594

@jappi00

Description

@jappi00

Laravel Version

12.0

PHP Version

8.4

Database Driver & Version

SQLite

Description

The whereNotMorphedTo function seems to not support sqllite. I think this should work since sqlite is a supported database. It is related to this operator: "<=>"

Steps To Reproduce

Create two models (video and comments). Comments morphs to video. Now try to call the whereNotMorphedTo and you will get this error:

SQLSTATE[HY000]: General error: 1 near ">": syntax error (Connection: sqlite, SQL: select * from "hostnames" where not (("hostnames"."hostnameable_type" <=> App\Models\ServiceOdoo and "hostnames"."hostnameable_id" in ( 37))) and "hostnames"."deleted_at" is null)

Example of calling:

use App\Models\Comment;
use App\Models\Video;

$video = Video::first();

Comment::whereNotMorphedTo('commentable', $video)->get();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions