Skip to content
Advertisement

How to resolve null return in Laravel query?

Given my Models Person and Student. Now, one of my controller is doing this:

JavaScript

During execution, everything has been save but My problem is why i am receiving null on die and dump?

By the way, my student tables’ primary and foreign key is the person_id column.

Edit

JavaScript

Advertisement

Answer

Add person_id in $fillable property:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement