Back

Accessor Issue


Hamid posted 6 months ago

Hi i want to know that when $snake_attribute is false and we have write a accessor for like Parent_id that will be getParentIdAttribute() then why this fuction does not get called for such records where parent_id is null. i mean if the 1st record in DB have the parent_id 5 then accessor will be executed but if parent_id holds null then accessor is not called and returned null.

however if snake_case is true then it called for both cases NULL and Values case.


Sign in to participate in this thread!



We'd like to thank these amazing companies for supporting us