has('announcement_enabled')) { Setting::set('announcement_enabled', '0'); } if ($request->has('shop_offline_submitted')) { Setting::set('shop_offline', $request->boolean('shop_offline') ? '1' : '0'); } foreach ($fields as $field) { if ($request->has($field)) { $value = $request->input($field); Setting::set($field, is_string($value) ? trim($value) : $value); } } Setting::flushCache(); $tab = $request->input('active_tab'); $redirect = $tab ? redirect()->route('admin.content.index', ['tab' => $tab]) : redirect()->route('admin.content.index'); return $redirect->with('success', 'Layout en teksten zijn direct opgeslagen en live bijgewerkt in de webshop!'); } /** * Reset specific settings or all back to default. */ public function reset(): RedirectResponse { $keys = [ 'site_name', 'site_tagline', 'meta_description', 'theme_palette', 'announcement_enabled', 'announcement_text', 'announcement_badge_1', 'announcement_badge_2', 'hero_badge', 'hero_title', 'hero_subtitle', 'hero_primary_btn_text', 'hero_primary_btn_url', 'hero_secondary_btn_text', 'hero_secondary_btn_url', 'hero_stat_1_val', 'hero_stat_1_lbl', 'hero_stat_2_val', 'hero_stat_2_lbl', 'hero_stat_3_val', 'hero_stat_3_lbl', 'hero_card_badge', 'categories_tag', 'categories_title', 'categories_subtitle', 'featured_tag', 'featured_title', 'featured_subtitle', 'usp_tag', 'usp_title', 'usp_subtitle', 'usp_1_title', 'usp_1_desc', 'usp_2_title', 'usp_2_desc', 'usp_3_title', 'usp_3_desc', 'usp_4_title', 'usp_4_desc', 'usp_btn_text', 'footer_description', 'footer_status_text', 'footer_email', 'footer_shipping_text', 'footer_copyright', 'footer_payment_text', ]; foreach ($keys as $key) { Setting::forget($key); } Setting::flushCache(); return redirect()->route('admin.content.index') ->with('success', 'Alle teksten en lay-out instellingen zijn hersteld naar de standaarden.'); } /** * Send a test email to verify mail delivery (e.g. to Gmail). */ public function sendTestMail(Request $request): RedirectResponse { $validated = $request->validate([ 'test_email' => 'required|email', ]); $recipient = $validated['test_email']; $defaultMailer = config('mail.default'); $fromAddress = config('mail.from.address'); $fromName = config('mail.from.name', 'Jouwdriedee.nl'); $smtpHost = config('mail.mailers.smtp.host'); $smtpPort = config('mail.mailers.smtp.port'); try { Mail::html('
Deze e-mail bevestigt dat de e-mailverbinding succesvol tot stand is gebracht.
Ontvanger: '.e($recipient).'
Verzendende Driver: '.e($defaultMailer).'
SMTP Server: '.e($smtpHost).':'.e($smtpPort).'
Afzender: '.e($fromName).' <'.e($fromAddress).'>
Tijdstip: '.now()->format('d-m-Y H:i:s').'
Jouwdriedee.nl • 3D Printstudio & Webshop