Add contract management and invoice settings pages

- Created a new Blade view for managing brand contracts with forms for adding and editing contracts, including client and category selection.
- Implemented success message notifications for contract actions.
- Added a new Blade view for invoice settings, allowing customization of invoice number format, header branding, and default values for new invoices.
- Introduced a new PDF view for generating rate cards with customizable styles based on user profile settings.
- Developed a profile management page for rate cards, enabling users to update their identity, appearance, and visibility settings.
This commit is contained in:
I-Fun
2026-04-01 21:47:34 +07:00
parent d3c35ad730
commit 22f03ccca7
48 changed files with 2415 additions and 296 deletions

View File

@@ -3,36 +3,80 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rate Card — KOL Manager</title>
<title>Rate Card — {{ $profile->owner_name }}</title>
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap" rel="stylesheet">
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Nunito', sans-serif; background: #FFF8F0; color: #374151; padding: 40px 20px; }
.container { max-width: 800px; margin: 0 auto; }
body { font-family: 'Nunito', sans-serif; background: {{ $profile->bg_color }}; color: {{ $profile->text_color }}; padding: 40px 20px; }
.container { max-width: 820px; margin: 0 auto; }
.header { text-align: center; margin-bottom: 48px; }
.logo { font-size: 48px; margin-bottom: 12px; }
.title { font-size: 32px; font-weight: 900; color: #FFB7C5; }
.subtitle { color: #9CA3AF; margin-top: 6px; font-size: 14px; }
.logo-img { max-height: 100px; max-width: 200px; margin: 0 auto 16px; display: block; border-radius: 16px; }
.title { font-size: 32px; font-weight: 900; color: {{ $profile->accent_color }}; }
.tagline { color: #9CA3AF; margin-top: 6px; font-size: 14px; }
.contacts { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 20px; margin-top: 16px; }
.contact-pill {
display: inline-flex; align-items: center; gap-6px;
background: white; border: 1px solid {{ $profile->accent_color }}44;
border-radius: 99px; padding: 6px 14px; font-size: 12px; color: {{ $profile->text_color }};
text-decoration: none; transition: background 0.2s;
}
.contact-pill:hover { background: {{ $profile->accent_color }}18; }
.platform-section { margin-bottom: 32px; }
.platform-title { font-size: 18px; font-weight: 800; color: #374151; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.platform-title { font-size: 18px; font-weight: 800; color: {{ $profile->text_color }}; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card { background: white; border-radius: 24px; padding: 20px; border: 1px solid #FFE4EC; box-shadow: 0 2px 8px rgba(255,183,197,0.15); }
.card { background: white; border-radius: 24px; padding: 20px; border: 1px solid {{ $profile->accent_color }}33; box-shadow: 0 2px 8px {{ $profile->accent_color }}22; }
.service { font-weight: 700; color: #1F2937; margin-bottom: 6px; }
.type { display: inline-block; background: #FFF0F5; color: #FFB7C5; font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 20px; margin-bottom: 8px; }
.type { display: inline-block; background: {{ $profile->accent_color }}18; color: {{ $profile->accent_color }}; font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 20px; margin-bottom: 8px; }
.desc { font-size: 12px; color: #9CA3AF; margin-bottom: 12px; line-height: 1.5; }
.price { font-size: 22px; font-weight: 900; color: #FFB7C5; }
.price { font-size: 22px; font-weight: 900; color: {{ $profile->accent_color }}; }
.price-meta { font-size: 11px; color: #D1D5DB; margin-top: 2px; }
.negotiable { font-size: 11px; color: #F59E0B; font-weight: 600; }
.footer { text-align: center; margin-top: 60px; color: #D1D5DB; font-size: 12px; }
@media print { body { background: white; } .card { break-inside: avoid; } }
.pdf-btn {
display: inline-flex; align-items: center; gap: 6px;
background: {{ $profile->accent_color }}; color: white;
border: none; border-radius: 99px; padding: 10px 24px;
font-size: 14px; font-weight: 700; cursor: pointer;
text-decoration: none; transition: opacity 0.2s;
}
.pdf-btn:hover { opacity: 0.9; }
@media print { body { background: white; } .card { break-inside: avoid; } .pdf-btn { display: none; } }
</style>
</head>
<body>
<div class="container">
<div class="header">
<div class="logo">🐱</div>
<div class="title">Rate Card</div>
<div class="subtitle">Services & Pricing · {{ now()->format('Y') }}</div>
@if($profile->logo_path)
<img src="{{ route('files.serve-profile-logo') }}" alt="{{ $profile->owner_name }}" class="logo-img">
@else
<div style="font-size:56px; margin-bottom:12px;">🐱</div>
@endif
<div class="title">{{ $profile->owner_name }}</div>
@if($profile->tagline)
<div class="tagline">{{ $profile->tagline }}</div>
@endif
<div class="contacts" style="margin-top:14px">
@if($profile->whatsappUrl)
<a href="{{ $profile->whatsappUrl }}" target="_blank" class="contact-pill">📱 WhatsApp</a>
@endif
@if($profile->ig_handle)
<a href="https://instagram.com/{{ ltrim($profile->ig_handle, '@') }}" target="_blank" class="contact-pill">📸 @{{ $profile->ig_handle }}</a>
@endif
@if($profile->tiktok_handle)
<a href="https://tiktok.com/@{{ ltrim($profile->tiktok_handle, '@') }}" target="_blank" class="contact-pill">🎵 @{{ $profile->tiktok_handle }}</a>
@endif
@if($profile->youtube_handle)
<a href="https://youtube.com/{{ $profile->youtube_handle }}" target="_blank" class="contact-pill">▶️ {{ $profile->youtube_handle }}</a>
@endif
@if($profile->email)
<a href="mailto:{{ $profile->email }}" class="contact-pill">✉️ {{ $profile->email }}</a>
@endif
</div>
<div style="margin-top:20px">
<a href="{{ route('rate-cards.pdf') }}" class="pdf-btn">📄 Download PDF</a>
</div>
</div>
@forelse($rateCards as $platform => $cards)
@@ -51,8 +95,12 @@
@if($card->description)
<div class="desc">{{ $card->description }}</div>
@endif
@if($profile->show_prices)
<div class="price">{{ $card->formatted_price }}</div>
<div class="price-meta">{{ str_replace('_', ' ', $card->price_unit) }}</div>
@else
<div class="price" style="font-size:16px">On Request</div>
@endif
@if($card->is_negotiable)
<div class="negotiable">✦ Negotiable</div>
@endif
@@ -65,7 +113,8 @@
@endforelse
<div class="footer">
Generated by KOL Manager · Prices may vary. Contact for custom packages. 🐾
{{ $profile->custom_footer ?: 'Prices may vary. Contact for custom packages. 🐾' }}
<br>Generated by KOL Manager · {{ now()->format('Y') }}
</div>
</div>
</body>