function getActivateAction(ActivateUser $activateUserCommand, Router $router, Users $eUsers, Response $response) { $rUser = $eUsers->where('activation', $router->get('activation'))->oneOrFail(new NotFound('User not found. Maybe it was already activated?')); return $activateUserCommand->setUser($rUser)->onSuccess(function () use($response) { $response->redirect('/auth/activated?succesful'); })->onError(function () { return view('vendor/lfw/auth/src/Pckg/Auth/View/activationFailed'); })->execute(); }
public function resolve($value) { $table = $this->router->resolved('table'); $this->tables->setTable($table->table); $this->tables->setRecordClass(DatabaseRecord::class); if ($table->repository) { $this->tables->setRepository(context()->get(Repository::class . '.' . $table->repository)); } $this->dynamic->joinTranslationsIfTranslatable($this->tables); $this->dynamic->joinPermissionsIfPermissionable($this->tables); return $this->tables->where('id', $value)->oneOrFail(function () { $this->response->unauthorized('Record not found'); }); }
public function resolve($value) { $this->dynamic->joinTranslationsIfTranslatable($this->tables); $this->dynamic->joinPermissionsIfPermissionable($this->tables); return $this->tables->where('id', $value)->withFields(function (HasMany $fields) { $fields->joinTranslation(); $fields->joinFallbackTranslation(); $fields->withFieldType(); $fields->withSettings(); })->withTabs(function (HasMany $tabs) { $tabs->joinTranslation(); $tabs->joinFallbackTranslation(); })->oneOrFail(function () { $this->response->unauthorized('Table not found'); }); }
function getTakeloginAction(Response $response, Router $router) { $success = $this->auth->useFacebookProvider($this->facebook)->getProvider()->handleTakelogin(); $response->redirect($success ? '/?success' : $router->make('login') . '?error=fb'); }
/** * Respond with code 400, redirect to get action */ protected function postErrorResponse() { $this->flash->set('form', 'Invalid data posted, check data and resubmit form'); return $this->response->code(400)->redirect(); }