diff --git a/app/Livewire/Customer/WallOfLove/Edit.php b/app/Livewire/Customer/WallOfLove/Edit.php new file mode 100644 index 000000000..8b7dba9bd --- /dev/null +++ b/app/Livewire/Customer/WallOfLove/Edit.php @@ -0,0 +1,20 @@ +user_id !== auth()->id(), 403); + } +} diff --git a/app/Livewire/WallOfLoveBanner.php b/app/Livewire/WallOfLoveBanner.php deleted file mode 100644 index 292ecd7d3..000000000 --- a/app/Livewire/WallOfLoveBanner.php +++ /dev/null @@ -1,35 +0,0 @@ -put('wall_of_love_dismissed_'.auth()->id(), true, now()->addWeek()); - $this->dispatch('banner-dismissed'); - } - - public function shouldShowBanner(): bool - { - // Check if user has early adopter licenses (before June 1st, 2025) - $hasEarlyAdopterLicenses = auth()->user()->licenses()->where('created_at', '<', '2025-06-01')->exists(); - - // Check if user already submitted - $hasExistingSubmission = auth()->user()->wallOfLoveSubmissions()->exists(); - - // Check if banner was dismissed - $hasDismissedBanner = cache()->has('wall_of_love_dismissed_'.auth()->id()); - - return $hasEarlyAdopterLicenses && ! $hasExistingSubmission && ! $hasDismissedBanner; - } - - public function render() - { - return view('livewire.wall-of-love-banner'); - } -} diff --git a/app/Livewire/WallOfLoveSubmissionForm.php b/app/Livewire/WallOfLoveSubmissionForm.php index b74074652..10ab9aca8 100644 --- a/app/Livewire/WallOfLoveSubmissionForm.php +++ b/app/Livewire/WallOfLoveSubmissionForm.php @@ -10,34 +10,83 @@ class WallOfLoveSubmissionForm extends Component { use WithFileUploads; + public ?WallOfLoveSubmission $submission = null; + + public bool $isEditing = false; + public $name = ''; public $company = ''; public $photo; + public ?string $existingPhoto = null; + public $url = ''; public $testimonial = ''; - protected $rules = [ - 'name' => 'required|string|max:255', - 'company' => 'nullable|string|max:255', - 'photo' => 'nullable|image|max:2048', // 2MB max - 'url' => 'nullable|url|max:255', - 'testimonial' => 'nullable|string|max:1000', - ]; + public function mount(?WallOfLoveSubmission $submission = null): void + { + if ($submission && $submission->exists && $submission->user_id === auth()->id()) { + $this->submission = $submission; + $this->isEditing = true; + $this->name = $submission->name; + $this->company = $submission->company ?? ''; + $this->existingPhoto = $submission->photo_path; + $this->url = $submission->url ?? ''; + $this->testimonial = $submission->testimonial ?? ''; + } else { + // Pre-fill name if user has a name + $this->name = auth()->user()->name ?? ''; + } + } - public function mount() + public function rules(): array { - // Pre-fill name if user has a name - $this->name = auth()->user()->name ?? ''; + if ($this->isEditing) { + return [ + 'company' => 'nullable|string|max:255', + 'photo' => 'nullable|image|max:2048', + ]; + } + + return [ + 'name' => 'required|string|max:255', + 'company' => 'nullable|string|max:255', + 'photo' => 'nullable|image|max:2048', + 'url' => 'nullable|url|max:255', + 'testimonial' => 'nullable|string|max:1000', + ]; } - public function submit() + public function submit(): mixed { $this->validate(); + if ($this->isEditing && $this->submission) { + $data = [ + 'company' => $this->company ?: null, + ]; + + if ($this->photo) { + $data['photo_path'] = $this->photo->store('wall-of-love-photos', 'public'); + } elseif ($this->existingPhoto === null) { + $data['photo_path'] = null; + } + + $this->submission->update($data); + + if ($this->photo) { + $this->existingPhoto = $data['photo_path']; + $this->reset('photo'); + } + + session()->flash('success', 'Your listing has been updated.'); + + return null; + } + $photoPath = null; if ($this->photo) { $photoPath = $this->photo->store('wall-of-love-photos', 'public'); @@ -55,6 +104,11 @@ public function submit() return to_route('dashboard')->with('success', 'Thank you! Your submission has been received and is awaiting review.'); } + public function removeExistingPhoto(): void + { + $this->existingPhoto = null; + } + public function render() { return view('livewire.wall-of-love-submission-form'); diff --git a/package-lock.json b/package-lock.json index 214610184..1ca1fd9b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "kind-goose", + "name": "cyan-grizzly", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/resources/views/components/dashboard-menu.blade.php b/resources/views/components/dashboard-menu.blade.php deleted file mode 100644 index cedcb3c45..000000000 --- a/resources/views/components/dashboard-menu.blade.php +++ /dev/null @@ -1,62 +0,0 @@ -
- Welcome back, {{ auth()->user()->first_name ?? auth()->user()->name }} -
-- Our Plugin Developer Terms and Conditions have been updated. You must accept the new terms before you can submit new plugins. -
-{{ session('success') }}
-{{ session('message') }}
-{{ session('error') }}
-- Manage your plugins and track your earnings -
-{{ session('success') }}
-{{ session('message') }}
-- Our Plugin Developer Terms and Conditions have been updated. You must accept the new terms before you can submit new plugins. -
-Account Active
-Your account is fully set up to receive payouts
-Action Required
-Additional information needed for payouts
-{{ $plugin->name }}
-{{ $plugin->licenses_count }} sales
-- {{ $payout->pluginLicense->plugin->name ?? 'Unknown Plugin' }} -
-- {{ $payout->created_at->format('M j, Y') }} -
-- ${{ number_format($payout->developer_amount / 100, 2) }} -
- @if ($payout->status === \App\Enums\PayoutStatus::Transferred) - - Paid - - @elseif ($payout->status === \App\Enums\PayoutStatus::Pending) - - Pending - - @else - - Failed - - @endif -No payouts yet
-Payouts will appear here after you make your first sale
-{{ session('success') }}
-{{ session('warning') }}
-{{ session('error') }}
-nativephp/mobile repository. Plugin Dev Kit license holders can access nativephp/claude-code.- Need help? Join our Discord community. -
-- Manage your NativePHP licenses -
-- Use these credentials with Composer to install plugins from the NativePHP Plugin Marketplace. -
-1. Add the NativePHP plugins repository:
-composer config repositories.nativephp-plugins composer https://plugins.nativephp.com
- 2. Configure your credentials:
-composer config http-basic.plugins.nativephp.com {{ auth()->user()->email }} {{ $pluginLicenseKey }}
- - Are you sure you want to rotate your plugin license key? This action cannot be undone. -
-- After rotating your key, you will need to: -
-auth.json file in all projects- {{ $pluginLicense->plugin->name }} -
- @if($pluginLicense->plugin->description) -- {{ $pluginLicense->plugin->description }} -
- @endif -- Purchased {{ $pluginLicense->purchased_at->format('M j, Y') }} -
-- {{ $license->name }} -
-- {{ $license->policy_name }} -
- @else -- {{ $license->policy_name }} -
- @endif -- {{ $license->key }} -
-- Expires in {{ $daysUntilExpiry }} day{{ $daysUntilExpiry === 1 ? '' : 's' }} -
- - @if($isLegacyLicense) -- Lock in Early Access Pricing -
- @endif - @else -- @if($license->expires_at) - Expires {{ $license->expires_at->format('M j, Y') }} - @else - No expiration - @endif -
-- Created {{ $license->created_at->format('M j, Y') }} -
- @endif -- {{ $subLicense->parentLicense->policy_name ?? 'Sub-License' }} -
-- Sub-license -
-- {{ $subLicense->key }} -
-- @if($subLicense->expires_at) - Expires {{ $subLicense->expires_at->format('M j, Y') }} - @else - No expiration - @endif -
-- Assigned {{ $subLicense->created_at->format('M j, Y') }} -
-- You don't have any licenses yet. If you believe this is an error, please contact support. -
-- {{ $license->name }} -
-- {{ $license->policy_name }} -
- @else -- {{ $license->policy_name }} -
- @endif -- {{ $license->key }} -
-- Expires in {{ $daysUntilExpiry }} day{{ $daysUntilExpiry === 1 ? '' : 's' }} -
- - @if($isLegacyLicense) -- Lock in Early Access Pricing -
- @endif - @else -- @if($license->expires_at) - Expires {{ $license->expires_at->format('M j, Y') }} - @else - No expiration - @endif -
-- Created {{ $license->created_at->format('M j, Y') }} -
- @endif -- {{ $subLicense->parentLicense->policy_name ?? 'Sub-License' }} -
-- Sub-license -
-- {{ $subLicense->key }} -
-- @if($subLicense->expires_at) - Expires {{ $subLicense->expires_at->format('M j, Y') }} - @else - No expiration - @endif -
-- Assigned {{ $subLicense->created_at->format('M j, Y') }} -
-- You don't have any licenses yet. If you believe this is an error, please contact support. -
-{{ $license->policy_name }}
- @endif -- Details about your NativePHP license. -
-
- {{ $license->key }}
-
-
- - Your license expires in {{ $daysUntilExpiry }} day{{ $daysUntilExpiry === 1 ? '' : 's' }}. - Set up automatic renewal now to avoid interruption and lock in your Early Access Pricing! -
- -- @if($license->is_suspended) - This license has been suspended. Please contact support for assistance. - @elseif($isLegacyLicense) - This license has expired. You can still renew it to restore access. - - Renew now - - @else - This license has expired. Please renew your subscription to continue using NativePHP. - @endif -
-- Your purchase history will appear here once you make your first purchase. -
-- Use these credentials with Composer to install plugins from the NativePHP Plugin Marketplace. -
-1. Add the NativePHP plugins repository:
-composer config repositories.nativephp-plugins composer https://plugins.nativephp.com
- 2. Configure your credentials:
-composer config http-basic.plugins.nativephp.com {{ auth()->user()->email }} {{ $pluginLicenseKey }}
- - Are you sure you want to rotate your plugin license key? This action cannot be undone. -
-- After rotating your key, you will need to: -
-auth.json file in all projects{{ session('success') }}
-- {{ $pluginLicense->plugin->name }} -
- @if($pluginLicense->plugin->description) -- {{ $pluginLicense->plugin->description }} -
- @endif -- Purchased {{ $pluginLicense->purchased_at->format('M j, Y') }} -
- @if($pluginLicense->wasPurchasedAsBundle() && $pluginLicense->pluginBundle) -- Part of {{ $pluginLicense->pluginBundle->name }} -
- @endif -- Browse the plugin marketplace to find premium plugins for your NativePHP app. -
- -- Share your NativePHP app with the community! Your submission will be reviewed by our team. -
-- Update the details of your showcase submission. -
-- Submit your NativePHP apps to be featured on our showcase -
-{{ session('success') }}
-{{ session('warning') }}
-- {{ $showcase->title }} -
-- Get started by submitting your first NativePHP app to the showcase. -
- -- As an early adopter, your story matters. Share your experience with NativePHP and inspire other developers in the community. -
-{{ session('success') }}
-- Thank you for supporting NativePHP from the beginning. As a reward, you can appear - permanently on our - Wall of Love. -
-- Your submission will be reviewed by our team and, once approved, will appear - on the page. -
-