laravel/framework — pull request #6292 by smgladkovskiy (2014-11-01 13:50:53+00:00)
Title: Check for foreign key with a null value for belongsTo relations...

... to avoid the creation of unnecessary query that obviously returns an empty result. Fixes #4371.