Slim php / Eloquent custom query for hasMany-relation
问题 I'm currently working with Slim php-framework and eloquent-database: https://www.slimframework.com/docs/cookbook/database-eloquent.html What I want to do is to use a custom SQL-query to set up a hasMany-relation of two models. Let's say, I have two models "User" and "Entry". My User.php looks like this class User extends \Illuminate\Database\Eloquent\Model { protected $table = 'users'; public function entries() { return $this->hasMany('foo\bar\Entry'); } } To fetch the entries I use the