App\Http\Controllers\AccountController::showSection PHP Method

showSection() public method

public showSection ( boolean $section = false ) : Illuminate\Contracts\View\View | Illuminate\Http\RedirectResponse
$section boolean
return Illuminate\Contracts\View\View | Illuminate\Http\RedirectResponse
    public function showSection($section = false)
    {
        if (!Auth::user()->is_admin) {
            return Redirect::to('/settings/user_details');
        }
        if (!$section) {
            return Redirect::to('/settings/' . ACCOUNT_COMPANY_DETAILS, 301);
        }
        if ($section == ACCOUNT_COMPANY_DETAILS) {
            return self::showCompanyDetails();
        } elseif ($section == ACCOUNT_LOCALIZATION) {
            return self::showLocalization();
        } elseif ($section == ACCOUNT_PAYMENTS) {
            return self::showOnlinePayments();
        } elseif ($section == ACCOUNT_BANKS) {
            return self::showBankAccounts();
        } elseif ($section == ACCOUNT_INVOICE_SETTINGS) {
            return self::showInvoiceSettings();
        } elseif ($section == ACCOUNT_IMPORT_EXPORT) {
            return View::make('accounts.import_export', ['title' => trans('texts.import_export')]);
        } elseif ($section == ACCOUNT_MANAGEMENT) {
            return self::showAccountManagement();
        } elseif ($section == ACCOUNT_INVOICE_DESIGN || $section == ACCOUNT_CUSTOMIZE_DESIGN) {
            return self::showInvoiceDesign($section);
        } elseif ($section == ACCOUNT_CLIENT_PORTAL) {
            return self::showClientPortal();
        } elseif ($section === ACCOUNT_TEMPLATES_AND_REMINDERS) {
            return self::showTemplates();
        } elseif ($section === ACCOUNT_PRODUCTS) {
            return self::showProducts();
        } elseif ($section === ACCOUNT_TAX_RATES) {
            return self::showTaxRates();
        } elseif ($section === ACCOUNT_PAYMENT_TERMS) {
            return self::showPaymentTerms();
        } elseif ($section === ACCOUNT_SYSTEM_SETTINGS) {
            return self::showSystemSettings();
        } else {
            $data = ['account' => Account::with('users')->findOrFail(Auth::user()->account_id), 'title' => trans("texts.{$section}"), 'section' => $section];
            return View::make("accounts.{$section}", $data);
        }
    }