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:
+136
@@ -0,0 +1,136 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Análise de Visitantes')
|
||||
|
||||
@section('content')
|
||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||
<h1 class="h3 mb-0 text-gray-800">Análise de Visitantes</h1>
|
||||
<a href="{{ route('admin.marketing.index') }}" class="btn btn-sm btn-secondary shadow-sm">
|
||||
<i class="bi bi-arrow-left text-white-50"></i> Voltar
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Gráfico de Acessos (Últimos 7 dias) -->
|
||||
<div class="col-xl-12 col-lg-12">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Acessos nos Últimos 7 Dias</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="chart-area">
|
||||
<canvas id="accessChart" style="height: 300px;"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Ranking por País -->
|
||||
<div class="col-lg-6">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Top 10 Países</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>País</th>
|
||||
<th class="text-center">Acessos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($countries as $country)
|
||||
<tr>
|
||||
<td><i class="bi bi-globe-americas text-muted me-2"></i> {{ $country->country }}</td>
|
||||
<td class="text-center"><span class="badge badge-primary">{{ $country->total }}</span></td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="2" class="text-center">Nenhum dado capturado ainda.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Ranking por Cidade -->
|
||||
<div class="col-lg-6">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Top 10 Cidades</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Cidade / Região</th>
|
||||
<th class="text-center">Acessos</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($cities as $city)
|
||||
<tr>
|
||||
<td><i class="bi bi-geo-alt text-danger me-2"></i> {{ $city->city }} ({{ $city->region }})</td>
|
||||
<td class="text-center"><span class="badge badge-success">{{ $city->total }}</span></td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="2" class="text-center">Nenhum dado capturado ainda.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-info border-0 shadow-sm small">
|
||||
<i class="bi bi-info-circle me-2"></i> <strong>Nota:</strong> A localização é estimada com base no endereço IP do visitante. A precisão pode variar dependendo do provedor de internet. Os dados são capturados apenas em páginas públicas (não administrativas).
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script>
|
||||
const ctx = document.getElementById('accessChart').getContext('2d');
|
||||
const accessChart = new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: JSON.parse('<?php echo json_encode($last7Days->pluck("date")); ?>'),
|
||||
datasets: [{
|
||||
label: 'Visitas',
|
||||
data: JSON.parse('<?php echo json_encode($last7Days->pluck("total")); ?>'),
|
||||
backgroundColor: 'rgba(78, 115, 223, 0.05)',
|
||||
borderColor: 'rgba(78, 115, 223, 1)',
|
||||
pointRadius: 3,
|
||||
pointBackgroundColor: 'rgba(78, 115, 223, 1)',
|
||||
pointBorderColor: 'rgba(78, 115, 223, 1)',
|
||||
pointHoverRadius: 3,
|
||||
pointHoverBackgroundColor: 'rgba(78, 115, 223, 1)',
|
||||
pointHoverBorderColor: 'rgba(78, 115, 223, 1)',
|
||||
pointHitRadius: 10,
|
||||
pointBorderWidth: 2,
|
||||
fill: true,
|
||||
tension: 0.3
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
maintainAspectRatio: false,
|
||||
scales: {
|
||||
y: {
|
||||
beginAtZero: true,
|
||||
ticks: {
|
||||
stepSize: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'E-mail Marketing')
|
||||
|
||||
@section('content')
|
||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||
<h1 class="h3 mb-0 text-gray-800">Disparo de E-mail Marketing</h1>
|
||||
<a href="{{ route('admin.marketing.index') }}" class="btn btn-sm btn-secondary shadow-sm">
|
||||
<i class="bi bi-arrow-left text-white-50"></i> Voltar
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@if(session('success'))
|
||||
<div class="alert alert-success border-0 shadow-sm mb-4">{{ session('success') }}</div>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Compor E-mail Promocional</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('admin.marketing.email.send') }}" method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label class="font-weight-bold">Assunto do E-mail</label>
|
||||
<input type="text" name="subject" class="form-control @error('subject') is-invalid @enderror" value="{{ old('subject') }}" placeholder="Ex: Oferta Especial: 20% de desconto em Notebooks!" required>
|
||||
@error('subject') <div class="invalid-feedback">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label class="font-weight-bold">Mensagem</label>
|
||||
<textarea name="message" id="editor" class="form-control @error('message') is-invalid @enderror" rows="10">{{ old('message') }}</textarea>
|
||||
@error('message') <div class="invalid-feedback">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group mb-3">
|
||||
<label class="font-weight-bold">Texto do Botão (Opcional)</label>
|
||||
<input type="text" name="button_text" class="form-control" value="{{ old('button_text') }}" placeholder="Ex: Ver Oferta">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group mb-3">
|
||||
<label class="font-weight-bold">URL do Botão (Opcional)</label>
|
||||
<input type="url" name="button_url" class="form-control" value="{{ old('button_url') }}" placeholder="Ex: https://seusite.com/promo">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="form-group mb-4">
|
||||
<label class="font-weight-bold text-primary"><i class="bi bi-image me-1"></i> Incluir Imagem de Destaque (Opcional)</label>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<label class="small text-muted">Escolher um Produto:</label>
|
||||
<select name="product_id" class="form-control form-control-sm mb-2">
|
||||
<option value="">Nenhum produto</option>
|
||||
@foreach($products as $product)
|
||||
<option value="{{ $product->id }}">{{ $product->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="small text-muted">Ou escolher um Serviço:</label>
|
||||
<select name="service_id" class="form-control form-control-sm mb-2">
|
||||
<option value="">Nenhum serviço</option>
|
||||
@foreach($services as $service)
|
||||
<option value="{{ $service->id }}">{{ $service->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<small class="text-muted">A imagem principal do item selecionado será enviada no topo do e-mail.</small>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary btn-block py-3 fw-bold shadow-sm" onclick="return confirm('Deseja enviar este e-mail para todos os {{ $userCount }} clientes cadastrados?')">
|
||||
<i class="bi bi-send me-1"></i> Disparar E-mail para {{ $userCount }} Clientes
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3 bg-light">
|
||||
<h6 class="m-0 font-weight-bold text-dark">Informações Importantes</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="alert alert-info small border-0">
|
||||
<i class="bi bi-info-circle me-1"></i> Os e-mails serão enviados para todos os usuários com o tipo "User" que possuem a preferência de e-mail ativada.
|
||||
</div>
|
||||
<h6 class="font-weight-bold small">Dicas para um bom e-mail:</h6>
|
||||
<ul class="small text-muted pl-3">
|
||||
<li>Use um assunto curto e chamativo.</li>
|
||||
<li>Vá direto ao ponto na mensagem.</li>
|
||||
<li>Sempre inclua um botão de ação (CTA).</li>
|
||||
<li>Evite e-mails muito longos com muitas imagens.</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<p class="small text-center text-muted mb-0">Total de destinatários aptos: <br><strong>{{ $userCount }} clientes</strong></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('css')
|
||||
<link href="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote-bs4.min.css" rel="stylesheet">
|
||||
@endpush
|
||||
|
||||
@push('js')
|
||||
<script src="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote-bs4.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#editor').summernote({
|
||||
height: 300,
|
||||
tabsize: 2,
|
||||
toolbar: [
|
||||
['style', ['style']],
|
||||
['font', ['bold', 'underline', 'clear']],
|
||||
['color', ['color']],
|
||||
['para', ['ul', 'ol', 'paragraph']],
|
||||
['view', ['fullscreen', 'codeview']]
|
||||
]
|
||||
});
|
||||
|
||||
// Garantir que apenas um select de imagem seja usado
|
||||
$('select[name="product_id"]').change(function() {
|
||||
if($(this).val() != "") $('select[name="service_id"]').val("");
|
||||
});
|
||||
$('select[name="service_id"]').change(function() {
|
||||
if($(this).val() != "") $('select[name="product_id"]').val("");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+182
@@ -0,0 +1,182 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Marketing & Promoção')
|
||||
|
||||
@section('content')
|
||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||
<h1 class="h3 mb-0 text-gray-800">Marketing & Promoção</h1>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Card Banners -->
|
||||
<div class="col-xl-4 col-md-6 mb-4">
|
||||
<div class="card border-left-primary shadow h-100 py-2">
|
||||
<div class="card-body">
|
||||
<div class="row no-gutters align-items-center">
|
||||
<div class="col me-2">
|
||||
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
|
||||
Destaques do Site</div>
|
||||
<div class="h5 mb-0 font-weight-bold text-gray-800">Gerenciar Banners</div>
|
||||
<p class="small text-muted mt-2">Crie banners rotativos para a página inicial para promover novidades e ofertas.</p>
|
||||
<a href="{{ route('admin.marketing.banners.index') }}" class="btn btn-sm btn-primary">Acessar</a>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<i class="bi bi-images text-gray-300"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Card Promoção de Produtos -->
|
||||
<div class="col-xl-4 col-md-6 mb-4">
|
||||
<div class="card border-left-success shadow h-100 py-2">
|
||||
<div class="card-body">
|
||||
<div class="row no-gutters align-items-center">
|
||||
<div class="col me-2">
|
||||
<div class="text-xs font-weight-bold text-success text-uppercase mb-1">
|
||||
Vendas Rápidas</div>
|
||||
<div class="h5 mb-0 font-weight-bold text-gray-800">Promover Produtos</div>
|
||||
<p class="small text-muted mt-2">Gere links de compartilhamento para WhatsApp e Redes Sociais com mensagens prontas.</p>
|
||||
<a href="{{ route('admin.marketing.promote.products') }}" class="btn btn-sm btn-success">Acessar</a>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<i class="bi bi-share text-gray-300"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Card Promoção de Serviços -->
|
||||
<div class="col-xl-4 col-md-6 mb-4">
|
||||
<div class="card border-left-warning shadow h-100 py-2">
|
||||
<div class="card-body">
|
||||
<div class="row no-gutters align-items-center">
|
||||
<div class="col me-2">
|
||||
<div class="text-xs font-weight-bold text-warning text-uppercase mb-1">
|
||||
Atrair Clientes</div>
|
||||
<div class="h5 mb-0 font-weight-bold text-gray-800">Promover Serviços</div>
|
||||
<p class="small text-muted mt-2">Promova seus serviços especializados e atraia novas solicitações de orçamento.</p>
|
||||
<a href="{{ route('admin.marketing.promote.services') }}" class="btn btn-sm btn-warning text-white">Acessar</a>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<i class="bi bi-bell text-gray-300"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Card E-mail Marketing -->
|
||||
<div class="col-xl-4 col-md-6 mb-4">
|
||||
<div class="card border-left-danger shadow h-100 py-2">
|
||||
<div class="card-body">
|
||||
<div class="row no-gutters align-items-center">
|
||||
<div class="col me-2">
|
||||
<div class="text-xs font-weight-bold text-danger text-uppercase mb-1">
|
||||
Fidelização</div>
|
||||
<div class="h5 mb-0 font-weight-bold text-gray-800">E-mail Marketing</div>
|
||||
<p class="small text-muted mt-2">Envie promoções, novidades e ofertas personalizadas para todos os seus clientes por e-mail.</p>
|
||||
<a href="{{ route('admin.marketing.email') }}" class="btn btn-sm btn-danger shadow-sm">Configurar Disparo</a>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<i class="bi bi-envelope-open text-gray-300"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Card Visitantes -->
|
||||
<div class="col-xl-4 col-md-6 mb-4">
|
||||
<div class="card border-left-dark shadow h-100 py-2">
|
||||
<div class="card-body">
|
||||
<div class="row no-gutters align-items-center">
|
||||
<div class="col me-2">
|
||||
<div class="text-xs font-weight-bold text-dark text-uppercase mb-1">
|
||||
Geolocalização</div>
|
||||
<div class="h5 mb-0 font-weight-bold text-gray-800">Análise de Visitantes</div>
|
||||
<p class="small text-muted mt-2">Visualize de quais cidades e países as pessoas estão acessando o seu site em tempo real.</p>
|
||||
<a href="{{ route('admin.marketing.analytics') }}" class="btn btn-sm btn-dark shadow-sm">Ver Relatórios</a>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<i class="bi bi-geo-alt text-gray-300"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Card SEO -->
|
||||
<div class="col-xl-4 col-md-6 mb-4">
|
||||
<div class="card border-left-info shadow h-100 py-2">
|
||||
<div class="card-body">
|
||||
<div class="row no-gutters align-items-center">
|
||||
<div class="col me-2">
|
||||
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">
|
||||
Visibilidade</div>
|
||||
<div class="h5 mb-0 font-weight-bold text-gray-800">Configurações de SEO</div>
|
||||
<p class="small text-muted mt-2">Ajuste as meta-tags globais do site para melhorar o ranqueamento no Google.</p>
|
||||
<a href="{{ route('admin.settings.index') }}#seo" class="btn btn-sm btn-info">Configurar</a>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<i class="bi bi-search text-gray-300"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Promoção SysCRM -->
|
||||
<div class="card shadow mb-4 border-bottom-primary overflow-hidden">
|
||||
<div class="row no-gutters">
|
||||
<div class="col-md-4 bg-primary d-flex align-items-center justify-content-center p-5">
|
||||
<div class="text-center text-white">
|
||||
<i class="bi bi-people mb-3"></i>
|
||||
<h2 class="font-weight-bold">SysCRM</h2>
|
||||
<p class="lead">Gestão de Relacionamento</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body p-5">
|
||||
<h3 class="font-weight-bold text-primary mb-3">Potencialize suas vendas com o SysCRM</h3>
|
||||
<p class="text-muted lead">Integre sua estratégia de marketing com a melhor ferramenta de gestão de clientes. O SysCRM permite que você acompanhe cada lead gerado pelo seu site, organize seu funil de vendas e nunca perca um negócio.</p>
|
||||
<ul class="list-unstyled mb-4">
|
||||
<li class="mb-2"><i class="bi bi-check-circle text-success me-2"></i> Funil de Vendas Visual e Intuitivo</li>
|
||||
<li class="mb-2"><i class="bi bi-check-circle text-success me-2"></i> Gestão de Contatos e Histórico Completo</li>
|
||||
<li class="mb-2"><i class="bi bi-check-circle text-success me-2"></i> Automação de Tarefas e Lembretes</li>
|
||||
<li><i class="bi bi-check-circle text-success me-2"></i> Integração Direta com seu Site</li>
|
||||
</ul>
|
||||
<div class="d-flex gap-3">
|
||||
<a href="https://syscrm.syspanel.com.br" target="_blank" class="btn btn-primary btn-lg px-5 shadow-sm">
|
||||
<i class="bi bi-box-arrow-up-right me-2"></i> Conhecer o SysCRM
|
||||
</a>
|
||||
<a href="https://wa.me/5535992261684?text=Olá! Tenho interesse no SysCRM." target="_blank" class="btn btn-success btn-lg px-5 shadow-sm">
|
||||
<i class="bi bi-whatsapp me-2"></i> Tenho Interesse
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Dicas de Marketing</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h5 class="font-weight-bold"><i class="bi bi-whatsapp text-success me-2"></i> WhatsApp Marketing</h5>
|
||||
<p>Use a ferramenta de <strong>Promover Produtos</strong> para enviar ofertas personalizadas aos seus clientes. Uma mensagem com foto e link direto aumenta em 40% a chance de conversão.</p>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h5 class="font-weight-bold"><i class="bi bi-megaphone text-primary me-2"></i> Banners Estratégicos</h5>
|
||||
<p>Mantenha sempre pelo menos 2 banners ativos: um com um produto em destaque e outro com um serviço ou diferencial da sua empresa (ex: "Orçamento Grátis").</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Promover Produtos')
|
||||
|
||||
@section('content')
|
||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||
<h1 class="h3 mb-0 text-gray-800">Promover Produtos</h1>
|
||||
<a href="{{ route('admin.marketing.index') }}" class="btn btn-sm btn-secondary shadow-sm">
|
||||
<i class="bi bi-arrow-left text-white-50"></i> Voltar
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Ferramentas de Compartilhamento</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="text-muted mb-4">Escolha um produto abaixo para gerar links de compartilhamento rápido em suas redes sociais e WhatsApp.</p>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover border" width="100%" cellspacing="0">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th width="80">Foto</th>
|
||||
<th>Produto</th>
|
||||
<th>Categoria</th>
|
||||
<th>Preço</th>
|
||||
<th width="350">Links de Promoção</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($products as $product)
|
||||
<tr>
|
||||
<td>
|
||||
@if($product->image)
|
||||
<img src="{{ asset('storage/' . $product->image) }}" class="img-thumbnail" style="height: 40px; width: 40px; object-fit: cover;">
|
||||
@else
|
||||
<div class="bg-light d-flex align-items-center justify-content-center" style="height: 40px; width: 40px;">
|
||||
<i class="bi bi-box text-muted"></i>
|
||||
</div>
|
||||
@endif
|
||||
</td>
|
||||
<td class="font-weight-bold text-dark">{{ $product->name }}</td>
|
||||
<td>
|
||||
<span class="badge badge-info">{{ $product->category->name ?? 'Sem Categoria' }}</span>
|
||||
</td>
|
||||
<td>R$ {{ number_format($product->price, 2, ',', '.') }}</td>
|
||||
<td>
|
||||
@php
|
||||
$productLink = route('produtos', ['categoria' => $product->category->slug ?? '']);
|
||||
$productPrice = number_format($product->price, 2, ',', '.');
|
||||
|
||||
$rawMessage = \App\Models\Setting::get('marketing_product_text', 'Confira este produto incrível: {name} por apenas R$ {price}. Veja mais detalhes aqui: {link}');
|
||||
$shareMessage = str_replace(
|
||||
['{name}', '{price}', '{link}'],
|
||||
[$product->name, $productPrice, $productLink],
|
||||
$rawMessage
|
||||
);
|
||||
@endphp
|
||||
<div class="btn-group">
|
||||
<!-- WhatsApp Share -->
|
||||
<a href="https://wa.me/?text={{ urlencode($shareMessage) }}"
|
||||
target="_blank" class="btn btn-sm btn-success" title="Enviar para WhatsApp">
|
||||
<i class="bi bi-whatsapp me-1"></i> WhatsApp
|
||||
</a>
|
||||
|
||||
<!-- Facebook Share -->
|
||||
<a href="https://www.facebook.com/sharer/sharer.php?u={{ urlencode($productLink) }}"
|
||||
target="_blank" class="btn btn-sm btn-primary" title="Compartilhar no Facebook">
|
||||
<i class="bi bi-facebook me-1"></i> Facebook
|
||||
</a>
|
||||
|
||||
<!-- LinkedIn Share -->
|
||||
<a href="https://www.linkedin.com/sharing/share-offsite/?url={{ urlencode($productLink) }}"
|
||||
target="_blank" class="btn btn-sm btn-info" title="Compartilhar no LinkedIn">
|
||||
<i class="bi bi-linkedin me-1"></i> LinkedIn
|
||||
</a>
|
||||
|
||||
<!-- Copy Link -->
|
||||
<button type="button" class="btn btn-sm btn-light border copy-link"
|
||||
data-url="{{ $productLink }}" title="Copiar Link">
|
||||
<i class="bi bi-link-45deg"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.copy-link').click(function() {
|
||||
var url = $(this).data('url');
|
||||
var tempInput = $("<input>");
|
||||
$("body").append(tempInput);
|
||||
tempInput.val(url).select();
|
||||
document.execCommand("copy");
|
||||
tempInput.remove();
|
||||
|
||||
$(this).removeClass('btn-light').addClass('btn-dark text-white');
|
||||
var btn = $(this);
|
||||
setTimeout(function() {
|
||||
btn.removeClass('btn-dark text-white').addClass('btn-light');
|
||||
}, 1000);
|
||||
|
||||
alert('Link copiado para a área de transferência!');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', 'Promover Serviços')
|
||||
|
||||
@section('content')
|
||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||
<h1 class="h3 mb-0 text-gray-800">Promover Serviços</h1>
|
||||
<a href="{{ route('admin.marketing.index') }}" class="btn btn-sm btn-secondary shadow-sm">
|
||||
<i class="bi bi-arrow-left text-white-50"></i> Voltar
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Ferramentas de Compartilhamento de Serviços</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="text-muted mb-4">Escolha um serviço abaixo para gerar links de compartilhamento rápido e atrair novos orçamentos.</p>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover border" width="100%" cellspacing="0">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th width="80">Ícone</th>
|
||||
<th>Serviço</th>
|
||||
<th width="350">Links de Promoção</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($services as $service)
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
@if($service->icon)
|
||||
<i class="{{ $service->icon }} text-primary"></i>
|
||||
@else
|
||||
<i class="bi bi-bell text-muted"></i>
|
||||
@endif
|
||||
</td>
|
||||
<td class="font-weight-bold text-dark">{{ $service->name }}</td>
|
||||
<td>
|
||||
@php
|
||||
$serviceLink = route('servicos');
|
||||
|
||||
$rawMessage = \App\Models\Setting::get('marketing_service_text', 'Precisa de {name}? Nós podemos te ajudar! Confira nossos serviços aqui: {link}');
|
||||
$shareMessage = str_replace(
|
||||
['{name}', '{link}'],
|
||||
[$service->name, $serviceLink],
|
||||
$rawMessage
|
||||
);
|
||||
@endphp
|
||||
<div class="btn-group">
|
||||
<!-- WhatsApp Share -->
|
||||
<a href="https://wa.me/?text={{ urlencode($shareMessage) }}"
|
||||
target="_blank" class="btn btn-sm btn-success" title="Enviar para WhatsApp">
|
||||
<i class="bi bi-whatsapp me-1"></i> WhatsApp
|
||||
</a>
|
||||
|
||||
<!-- Facebook Share -->
|
||||
<a href="https://www.facebook.com/sharer/sharer.php?u={{ urlencode($serviceLink) }}"
|
||||
target="_blank" class="btn btn-sm btn-primary" title="Compartilhar no Facebook">
|
||||
<i class="bi bi-facebook me-1"></i> Facebook
|
||||
</a>
|
||||
|
||||
<!-- LinkedIn Share -->
|
||||
<a href="https://www.linkedin.com/sharing/share-offsite/?url={{ urlencode($serviceLink) }}"
|
||||
target="_blank" class="btn btn-sm btn-info" title="Compartilhar no LinkedIn">
|
||||
<i class="bi bi-linkedin me-1"></i> LinkedIn
|
||||
</a>
|
||||
|
||||
<!-- Copy Link -->
|
||||
<button type="button" class="btn btn-sm btn-light border copy-link"
|
||||
data-url="{{ $serviceLink }}" title="Copiar Link">
|
||||
<i class="bi bi-link-45deg"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.copy-link').click(function() {
|
||||
var url = $(this).data('url');
|
||||
var tempInput = $("<input>");
|
||||
$("body").append(tempInput);
|
||||
tempInput.val(url).select();
|
||||
document.execCommand("copy");
|
||||
tempInput.remove();
|
||||
|
||||
$(this).removeClass('btn-light').addClass('btn-dark text-white');
|
||||
var btn = $(this);
|
||||
setTimeout(function() {
|
||||
btn.removeClass('btn-dark text-white').addClass('btn-light');
|
||||
}, 1000);
|
||||
|
||||
alert('Link copiado para a área de transferência!');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
Reference in New Issue
Block a user