Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Steady-Entertainment's avatar

WHat is he doing?

https://laracasts.com/series/lets-build-a-forum-with-laravel/episodes/65

22:25

I don't understand the curly braces around src and file

{src, file}

is this object de-structuring or what is this ?

It looks like he is making a new object but there is no key word like

let or const or var

I am confused

0 likes
2 replies
ahmeddabak's avatar
Level 47

yes he is emitting an event which takes two parameters, the name of the event loaded and the payload, which is an anonymous object.

he could have wrote this, it would have been the same

let payload = {
    src : ....,
    file ...
}

this.$emit('loaded', payload);
1 like

Please or to participate in this conversation.