I have a Model setup as so:
Okay I believe this is what you're looking for ...
Upload.php (no changes here)
hasOne('App\Models\Mime', 'mime');
}
}
Then you have your Mime model
Mime.php
if you do this for a test I believe you should see the type
routes.php
Route::get('test', function() {
$upload = \Upload::with('mime')->first();
// return $upload //here would return it as JSON I'm pretty sure!
return $upload->mime->type;
});
Check docs for further details on eager loading: http://laravel.com/docs/5.0/eloquent#eager-loading