<?php

namespace ViartasThemes\Florial\Controllers;

use Illuminate\Http\Request;

class NewsletterController
{
    public function subscribe(Request $request)
    {
        $request->validate([
            'email' => 'required|email',
        ]);

        $email = $request->input('email');

        // TODO: tavo logika čia
        // Newsletter::create(['email' => $email]);

        return response()->json([
            'success' => true,
            'message' => __('newsletter.success'),
        ]);
    }
}
