feat(cms): implement complete SysSiteCMS content management system
Initial implementation of the HomeSysPanel CMS built with Laravel 13.0. Includes complete admin panel, content management, user authentication, modular architecture for products/services/chatbot, and marketing tools. Key features: - User authentication with email verification and password reset - Role-based access control (Admin/User with granular permissions) - Content management (pages, news, FAQ, downloads, galleries, banners) - Contact management system with subjects and responses - Marketing tools (email campaigns, visitor analytics, social sharing) - Modular architecture (Products, Services, Chatbot modules) - AI Chatbot integration with OpenRouter.ai and LlamaCpp support - Visitor tracking with geolocation - SEO optimization with meta tags and Open Graph - Responsive design with Bootstrap 5 - Dark mode support - Maintenance mode - Feature request system
This commit is contained in:
+52
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\ContactMessage;
|
||||
use App\Models\ContactResponse;
|
||||
use App\Mail\ContactReplyMail;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class ContactController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$contacts = ContactMessage::with('subject')->latest()->paginate(10);
|
||||
return view('admin.contacts.index', compact('contacts'));
|
||||
}
|
||||
|
||||
public function show(ContactMessage $contact)
|
||||
{
|
||||
$contact->update(['read' => true]);
|
||||
$contact->load('responses.user', 'subject');
|
||||
return view('admin.contacts.show', compact('contact'));
|
||||
}
|
||||
|
||||
public function reply(Request $request, ContactMessage $contact)
|
||||
{
|
||||
$request->validate([
|
||||
'message' => 'required|string|min:10',
|
||||
]);
|
||||
|
||||
// 1. Salvar no Banco de Dados
|
||||
ContactResponse::create([
|
||||
'contact_message_id' => $contact->id,
|
||||
'user_id' => Auth::id(),
|
||||
'message' => $request->message,
|
||||
]);
|
||||
|
||||
// 2. Enviar E-mail
|
||||
Mail::to($contact->email)->send(new ContactReplyMail($contact, $request->message));
|
||||
|
||||
return redirect()->route('admin.contacts.show', $contact)->with('success', 'Resposta enviada e registrada com sucesso!');
|
||||
}
|
||||
|
||||
public function destroy(ContactMessage $contact)
|
||||
{
|
||||
$contact->delete();
|
||||
return redirect()->route('admin.contacts.index')->with('success', 'Mensagem excluída com sucesso.');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user