class BookController extends Controller
{
public function bookIndex($id, $slug) {
// echo $id works without a problem
$findcover = Thing::with(array('cover' => function($query) use ($id) {
$query->where('imageable_type', 'AppModelsThing')
->where('imageable_id', $id);
}))->find($id);
$maincover = $findcover->cover;
}