/** * Create a new event instance. * * @return void */ public function __construct(Status $status, User $user) { $this->status = $status; $this->user = $user; $this->notifiable = $status; $user->increment('status_count'); }
/** * Create a new event instance. * * @return void */ public function __construct(Topic $topic, User $user) { $this->topic = $topic; $this->user = $user; $this->notifiable = $topic; //patikrinam ar tema yra naujiena. if ($topic->node_id == 15) { event(new NewsWasPosted($topic)); } $user->increment('topic_count'); }
/** * Create a new event instance. * * @return void */ public function __construct(Reply $reply, Topic $topic, User $user) { $this->reply = $reply; $this->topic = $topic; $this->user = $user; $this->weight = Config::get('app.reply_gain_weight'); $this->karma = 0; $this->notifiable = $reply; $user->increment('reply_count'); $topic->increment('reply_count'); }