/** * Response for extension configuration. * * @param array $data * * @return mixed */ public function showConfigurationChanger(array $data) { $name = $data['extension']->name; set_meta('title', Foundation::memory()->get("extensions.available.{$name}.name", $name)); set_meta('description', trans('orchestra/foundation::title.extensions.configure')); return view('orchestra/foundation::extensions.configure', $data); }
/** * Send new registration e-mail to user. * * @param \Orchestra\Contracts\Foundation\Listener\Account\ProfileCreator $listener * @param \Orchestra\Model\User $user * @param string $password * * @return mixed */ protected function notifyCreatedUser(Listener $listener, Eloquent $user, $password) { // Converting the user to an object allow the data to be a generic // object. This allow the data to be transferred to JSON if the // mail is send using queue. $memory = Foundation::memory(); $site = $memory->get('site.name', 'Orchestra Platform'); $data = ['password' => $password, 'site' => $site, 'user' => $user instanceof Arrayable ? $user->toArray() : $user]; $subject = trans('orchestra/foundation::email.credential.register', ['site' => $site]); $message = Message::create(config('auth.register.email', 'emails.auth.register'), $data, $subject); $receipt = $user->notify($message); if ($receipt->failed()) { return $listener->profileCreatedWithoutNotification(); } return $listener->profileCreated(); }
/** * Request to reset password. * * @param \Orchestra\Contracts\Auth\Listener\PasswordResetLink $listener * @param array $input * * @return mixed */ public function store(PasswordResetLink $listener, array $input) { $validation = $this->validator->with($input); if ($validation->fails()) { return $listener->resetLinkFailedValidation($validation->getMessageBag()); } $memory = Foundation::memory(); $site = $memory->get('site.name', 'Orchestra Platform'); $data = ['email' => $input['email']]; $response = $this->password->sendResetLink($data, function ($mail) use($site) { $mail->subject(trans('orchestra/foundation::email.forgot.request', ['site' => $site])); }); if ($response != Password::RESET_LINK_SENT) { return $listener->resetLinkFailed($response); } return $listener->resetLinkSent($response); }
/** * Update an extension configuration. * * @param \Orchestra\Contracts\Extension\Listener\Configure $listener * @param \Illuminate\Support\Fluent $extension * @param array $input * * @return mixed */ public function update(Listener $listener, Fluent $extension, array $input) { if (!Extension::started($extension->get('name'))) { return $listener->suspend(404); } $validation = $this->validator->with($input, ["orchestra.validate: extension.{$extension->get('name')}"]); if ($validation->fails()) { return $listener->updateConfigurationFailedValidation($validation->getMessageBag(), $extension->uid); } $memory = Foundation::memory(); $config = (array) $memory->get("extension.active.{$extension->get('name')}.config", []); $input = new Fluent(array_merge($config, $input)); unset($input['_token']); Event::fire("orchestra.saving: extension.{$extension->get('name')}", [&$input]); $memory->put("extensions.active.{$extension->get('name')}.config", $input->getAttributes()); $memory->put("extension_{$extension->get('name')}", $input->getAttributes()); Event::fire("orchestra.saved: extension.{$extension->get('name')}", [$input]); return $listener->configurationUpdated($extension); }
/** * Reverse the migrations. * * @return void */ public function down() { Foundation::memory()->forget('acl_orchestra/story'); }