Skip to content
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

not working with hasOne? #11

Open
Cipa opened this issue Jun 26, 2018 · 0 comments
Open

not working with hasOne? #11

Cipa opened this issue Jun 26, 2018 · 0 comments

Comments

@Cipa
Copy link

Cipa commented Jun 26, 2018

I am not sure how to make it work with hasOne

Code is

Program::with('type')->find(['id' => 1, 'year' => 2018]);

in the model

public function type()
    {
        return $this->hasOne('Type', 'id', 'type_id');
    }

I get

A PHP Error was encountered

Severity: Notice

Message: Array to string conversion

Filename: Eloquent/Model.php

Line Number: 1149
An uncaught Exception was encountered

Type: Illuminate\Database\QueryException

Message: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'programs.Array' in 'where clause' (SQL: select * from `programs` where `programs`.`Array` in (1, 2018))

Filename: /shared/httpd/humber/hq/application/vendor/illuminate/database/Connection.php

Line Number: 647

Thanks

PS: I saw there might be a new version coming soon, how soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant