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
70 lines
2.1 KiB
PHP
Executable File
70 lines
2.1 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Notification;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use App\Notifications\FeatureRequestNotification;
|
|
use App\Models\Setting;
|
|
use App\Models\ContactMessage;
|
|
use App\Models\User;
|
|
|
|
class HomeController extends Controller
|
|
{
|
|
/**
|
|
* Create a new controller instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->middleware('auth');
|
|
}
|
|
|
|
/**
|
|
* Show the application dashboard.
|
|
*
|
|
* @return \Illuminate\Contracts\Support\Renderable
|
|
*/
|
|
public function index()
|
|
{
|
|
$metrics = [
|
|
'pending_tickets' => ContactMessage::where('read', false)->count(),
|
|
'total_contacts' => ContactMessage::count(),
|
|
'total_users' => User::where('user_type', 'User')->count(),
|
|
];
|
|
|
|
// Products module metrics (only when module is enabled)
|
|
if (module_enabled('products') && class_exists(\App\Modules\Products\Models\Product::class)) {
|
|
$metrics['total_products'] = \App\Modules\Products\Models\Product::where('active', true)->count();
|
|
}
|
|
|
|
// Services module metrics (only when module is enabled)
|
|
if (module_enabled('services') && class_exists(\App\Modules\Services\Models\Service::class)) {
|
|
$metrics['total_services'] = \App\Modules\Services\Models\Service::where('active', true)->count();
|
|
}
|
|
|
|
return view('home', compact('metrics'));
|
|
}
|
|
|
|
/**
|
|
* Send a feature request to SysSiteCMS.
|
|
*/
|
|
public function sendFeatureRequest(Request $request)
|
|
{
|
|
$request->validate([
|
|
'feature_description' => 'required|string|min:10',
|
|
]);
|
|
|
|
$user = Auth::user();
|
|
$description = $request->feature_description;
|
|
|
|
// Send notification to SysSiteCMS email
|
|
Notification::route('mail', 'contato@syspanel.com.br')
|
|
->notify(new FeatureRequestNotification($user, $description));
|
|
|
|
return redirect()->back()->with('success', 'Sua solicitação foi enviada com sucesso ao SysSiteCMS! Em breve entraremos em contato.');
|
|
}
|
|
}
|