/** * A helper function to check if the provided value can be used for a title or * uses the package translation * * @param string $value * @param string $key * * @return string|\Symfony\Component\Translation\TranslatorInterface */ private function titleWithTranslationFallback($value, $key) { if (is_string($value)) { return $value; } return rpPackageTrans($key); }
/** * Deletes the object with redirect * * @param int $id * @param string|null $redirectToAction the controller name and action method. * If the method has index method, it will not add the object key. If you provide string as url without @ * it will redirect to the given url * * @return \Illuminate\Http\RedirectResponse */ public function deleteWithRedirect($id, $redirectToAction = null) { $this->deleteByKey($id); return $this->createRedirectObjectWithSuccess(rpPackageTrans("messages.deleted"), null, $redirectToAction); }