This is driving me nuts. I have 2 tables;
- explanations and
- transactions.
In the models folder I have transaction.php
and explanation.php.
transactions.php:
<?php
class Transaction extends Eloquent {
public function explanation()
{
return $this->hasOne('Explanation');
}
}
explanation.php
<?php
class Explanation extends Eloquent {
}
I'm simply calling
Transaction::find(18)->explanation()->first();
The error that I'm receiving is
Method [hasone] is not defined on the Query class
Can anyone see where I'm going wrong?