Can I set default value for emit?

Hi

I want set a default value like this for parameter :

$this-> emit(‘mount’ ,$id, default value=1);

how I can do this?

Hey, @keivantatari

You can do it with the null operator like this:

$this->emit('mount', $id ?? 1);
1 Like