/** * Create a new event instance. * * @return void */ public function __construct(\App\Defence $defence) { $this->defence = $defence->load('attacks'); $this->tree = ['id' => $defence->tree->id, 'public' => $defence->tree->public]; $this->parent = ['type' => 'attack', 'id' => $defence->tempAttacks ? $defence->tempAttacks : $defence->attack->id]; }