Skip to content
Advertisement

how can i set value to an array like chaning methods?

i wanna set value with key to an arrau like chaning

I just want to know how Laravel did it

this is laravel code of eloquent update query

JavaScript

this is my code

JavaScript

It doesn’t work and it give me error

how this system work

Advertisement

Answer

You are mixing some things up here I guess.

JavaScript

BUT this would just be for a standard Class. When you are using an already existing class (in your example “Model”) you can not always access or change the attributes. That’s why you can often see methods like

JavaScript

Getter and Setter? I did a quick search. I think the link should clear up a couple of things. And for your code:

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