- Laravel Version: #.#.#
- 8.27.0
- PHP Version: #.#.#
- 7.4.3
- Database Driver & Version:
- Postgres 13
Description:
Calling relationship with non existing foreign key returns null instead of throwing error.
Steps To Reproduce:
- Create relationship in model (for example $user->role)
- Fill custom non-existing foreign key (for example: (return $this->belongsTo(Role::class, 'x');)
- Create $user = new User(); object and set role_id property to existing role id.
- Calling relationship $user->role returns null (looks like role doesnt exist in database) instead of throwing error.
Description:
Calling relationship with non existing foreign key returns null instead of throwing error.
Steps To Reproduce: