Removed code duplication
This commit is contained in:
@@ -26,10 +26,6 @@ class AppComposer
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$isEnabled = (bool) Setting::get('enable_subscribers', false);
|
||||
$mailAddress = env('MAIL_ADDRESS', false);
|
||||
$mailFrom = env('MAIL_NAME', false);
|
||||
|
||||
$view->withAboutApp(Markdown::convertToHtml(Setting::get('app_about')));
|
||||
$view->withAppBanner(Setting::get('app_banner'));
|
||||
$view->withAppBannerType(Setting::get('app_banner_type'));
|
||||
@@ -37,6 +33,5 @@ class AppComposer
|
||||
$view->withAppName(Setting::get('app_name'));
|
||||
$view->withAppUrl(Config::get('app.url'));
|
||||
$view->withShowSupport(Setting::get('show_support'));
|
||||
$view->withSubscribersEnabled($isEnabled && $mailAddress && $mailFrom);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<li>
|
||||
<a class="btn btn-link" href="{{ route('feed.atom') }}">{{ trans('cachet.atom-feed') }}</a>
|
||||
</li>
|
||||
@if($subscribers_enabled)
|
||||
@if(subscribers_enabled())
|
||||
<li>
|
||||
<a class="btn btn-success btn-outline" href="{{ route('subscribe.subscribe') }}">{{ trans('cachet.subscriber.button') }}</a>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user