/** * Handle the event. * * @param UserRegistered $event * @return void */ public function handle(UserRegistered $event) { if (!Spark::trialDays()) { return; } $this->notifications->create($event->user, ['icon' => 'fa-clock-o', 'body' => 'Your trial period will expire on ' . $event->user->trial_ends_at->format('F jS') . '.', 'action_text' => 'Subscribe', 'action_url' => '/settings#/subscription']); }
/** * {@inheritdoc} */ public function create(array $data) { $user = Spark::user(); $user->forceFill(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'last_read_announcements_at' => Carbon::now(), 'trial_ends_at' => Carbon::now()->addDays(Spark::trialDays())])->save(); return $user; }