diff --git a/app/Livewire/Components/NotificationsBell.php b/app/Livewire/Components/NotificationsBell.php index 817c263..4a44252 100644 --- a/app/Livewire/Components/NotificationsBell.php +++ b/app/Livewire/Components/NotificationsBell.php @@ -2,8 +2,12 @@ namespace App\Livewire\Components; +use Illuminate\Database\Eloquent\Collection; +use Illuminate\Notifications\DatabaseNotification; +use Illuminate\View\View; use Livewire\Component; +/** @property-read Collection $notifications */ class NotificationsBell extends Component { public bool $open = false; @@ -13,7 +17,8 @@ class NotificationsBell extends Component return auth()->user()?->unreadNotifications()->count() ?? 0; } - public function getNotificationsProperty() + /** @return Collection */ + public function getNotificationsProperty(): Collection { return auth()->user()?->notifications()->latest()->take(10)->get() ?? collect(); } @@ -34,7 +39,7 @@ class NotificationsBell extends Component $this->open = false; } - public function render() + public function render(): View { return view('livewire.components.notifications-bell'); } diff --git a/app/Livewire/Components/Toaster.php b/app/Livewire/Components/Toaster.php index a3a5f53..51fd465 100644 --- a/app/Livewire/Components/Toaster.php +++ b/app/Livewire/Components/Toaster.php @@ -2,11 +2,13 @@ namespace App\Livewire\Components; +use Illuminate\View\View; use Livewire\Attributes\On; use Livewire\Component; class Toaster extends Component { + /** @var array> */ public array $toasts = []; #[On('toast')] @@ -27,7 +29,7 @@ class Toaster extends Component ); } - public function render(): \Illuminate\View\View + public function render(): View { return view('livewire.components.toaster'); } diff --git a/app/Livewire/Modals/AddDomain.php b/app/Livewire/Modals/AddDomain.php index ba29125..32831bb 100644 --- a/app/Livewire/Modals/AddDomain.php +++ b/app/Livewire/Modals/AddDomain.php @@ -15,6 +15,7 @@ class AddDomain extends ModalComponent public string $hostname = ''; + /** @return array */ protected function rules(): array { return [ diff --git a/app/Livewire/Modals/ConfirmAction.php b/app/Livewire/Modals/ConfirmAction.php index 7d6d432..9b483ff 100644 --- a/app/Livewire/Modals/ConfirmAction.php +++ b/app/Livewire/Modals/ConfirmAction.php @@ -17,6 +17,7 @@ class ConfirmAction extends ModalComponent public string $confirmEvent = ''; + /** @var array */ public array $confirmEventParams = []; public bool $danger = false; diff --git a/app/Livewire/Modals/CreateApiToken.php b/app/Livewire/Modals/CreateApiToken.php index f895b1e..3c5a0dc 100644 --- a/app/Livewire/Modals/CreateApiToken.php +++ b/app/Livewire/Modals/CreateApiToken.php @@ -11,6 +11,7 @@ class CreateApiToken extends ModalComponent public ?string $plainTextToken = null; + /** @return array */ protected function rules(): array { return [ diff --git a/app/Livewire/Modals/CreateBioPage.php b/app/Livewire/Modals/CreateBioPage.php index 7a0a0bd..5dfa013 100644 --- a/app/Livewire/Modals/CreateBioPage.php +++ b/app/Livewire/Modals/CreateBioPage.php @@ -4,6 +4,7 @@ namespace App\Livewire\Modals; use App\Domains\Bio\Models\BioPage; use App\Domains\Workspace\Models\Workspace; +use App\Livewire\Pages\Bio\Index; use Illuminate\Support\Str; use Illuminate\View\View; use LivewireUI\Modal\ModalComponent; @@ -18,6 +19,7 @@ class CreateBioPage extends ModalComponent public string $slug = ''; + /** @return array */ protected function rules(): array { return [ @@ -58,7 +60,7 @@ class CreateBioPage extends ModalComponent 'is_published' => false, ]); - $this->dispatch('bio-created')->to(\App\Livewire\Pages\Bio\Index::class); + $this->dispatch('bio-created')->to(Index::class); $this->dispatch('toast', message: 'Bio Page erstellt', type: 'success'); $this->closeModal(); } diff --git a/app/Livewire/Modals/CreateWebhook.php b/app/Livewire/Modals/CreateWebhook.php index ad322fd..d78db7d 100644 --- a/app/Livewire/Modals/CreateWebhook.php +++ b/app/Livewire/Modals/CreateWebhook.php @@ -18,8 +18,10 @@ class CreateWebhook extends ModalComponent public string $secret = ''; + /** @var array */ public array $selectedEvents = []; + /** @var array */ public array $availableEvents = [ 'link.clicked' => 'Link clicked', 'link.created' => 'Link created', @@ -27,6 +29,7 @@ class CreateWebhook extends ModalComponent 'link.deleted' => 'Link deleted', ]; + /** @return array */ protected function rules(): array { return [ diff --git a/app/Livewire/Modals/CreateWorkspace.php b/app/Livewire/Modals/CreateWorkspace.php index 81bdc63..28409b8 100644 --- a/app/Livewire/Modals/CreateWorkspace.php +++ b/app/Livewire/Modals/CreateWorkspace.php @@ -10,6 +10,7 @@ class CreateWorkspace extends ModalComponent { public string $name = ''; + /** @return array */ protected function rules(): array { return [ diff --git a/app/Livewire/Modals/DeleteWorkspace.php b/app/Livewire/Modals/DeleteWorkspace.php index 273fd8b..53dc370 100644 --- a/app/Livewire/Modals/DeleteWorkspace.php +++ b/app/Livewire/Modals/DeleteWorkspace.php @@ -24,6 +24,7 @@ class DeleteWorkspace extends ModalComponent $this->workspaceName = $workspace->name; } + /** @return array */ protected function rules(): array { return [ @@ -31,6 +32,7 @@ class DeleteWorkspace extends ModalComponent ]; } + /** @return array */ protected function messages(): array { return [ diff --git a/app/Livewire/Modals/EditBioPage.php b/app/Livewire/Modals/EditBioPage.php index e3b4a7c..9bc620f 100644 --- a/app/Livewire/Modals/EditBioPage.php +++ b/app/Livewire/Modals/EditBioPage.php @@ -4,6 +4,7 @@ namespace App\Livewire\Modals; use App\Domains\Bio\Models\BioPage; use App\Domains\Workspace\Models\Workspace; +use App\Livewire\Pages\Bio\Index; use Illuminate\View\View; use LivewireUI\Modal\ModalComponent; @@ -32,6 +33,7 @@ class EditBioPage extends ModalComponent $this->isPublished = $bio->is_published; } + /** @return array */ protected function rules(): array { return [ @@ -55,7 +57,7 @@ class EditBioPage extends ModalComponent 'is_published' => $this->isPublished, ]); - $this->dispatch('bio-updated')->to(\App\Livewire\Pages\Bio\Index::class); + $this->dispatch('bio-updated')->to(Index::class); $this->dispatch('toast', message: 'Bio Page aktualisiert', type: 'success'); $this->closeModal(); } @@ -72,10 +74,10 @@ class EditBioPage extends ModalComponent private function authorizeWorkspace(int $workspaceId): void { - Workspace::where("id", $workspaceId) + Workspace::where('id', $workspaceId) ->where(fn ($q) => $q - ->where("owner_id", auth()->id()) - ->orWhereHas("members", fn ($q) => $q->where("user_id", auth()->id())) + ->where('owner_id', auth()->id()) + ->orWhereHas('members', fn ($q) => $q->where('user_id', auth()->id())) )->firstOrFail(); } } diff --git a/app/Livewire/Modals/EditLink.php b/app/Livewire/Modals/EditLink.php index a3d308a..97ff335 100644 --- a/app/Livewire/Modals/EditLink.php +++ b/app/Livewire/Modals/EditLink.php @@ -4,6 +4,7 @@ namespace App\Livewire\Modals; use App\Domains\Link\Models\Link; use App\Domains\Workspace\Models\Workspace; +use App\Livewire\Pages\Links\Index; use Illuminate\View\View; use LivewireUI\Modal\ModalComponent; @@ -38,6 +39,7 @@ class EditLink extends ModalComponent $this->status = $link->status; } + /** @return array */ protected function rules(): array { return [ @@ -63,7 +65,7 @@ class EditLink extends ModalComponent 'status' => $this->status, ]); - $this->dispatch('link-updated', linkUlid: $this->linkUlid)->to(\App\Livewire\Pages\Links\Index::class); + $this->dispatch('link-updated', linkUlid: $this->linkUlid)->to(Index::class); $this->dispatch('toast', message: 'Link aktualisiert', type: 'success'); $this->closeModal(); } @@ -75,10 +77,10 @@ class EditLink extends ModalComponent private function authorizeWorkspace(int $workspaceId): void { - Workspace::where("id", $workspaceId) + Workspace::where('id', $workspaceId) ->where(fn ($q) => $q - ->where("owner_id", auth()->id()) - ->orWhereHas("members", fn ($q) => $q->where("user_id", auth()->id())) + ->where('owner_id', auth()->id()) + ->orWhereHas('members', fn ($q) => $q->where('user_id', auth()->id())) )->firstOrFail(); } } diff --git a/app/Livewire/Modals/EditMemberRole.php b/app/Livewire/Modals/EditMemberRole.php index 70009ca..d540bcb 100644 --- a/app/Livewire/Modals/EditMemberRole.php +++ b/app/Livewire/Modals/EditMemberRole.php @@ -17,6 +17,7 @@ class EditMemberRole extends ModalComponent public string $role = 'editor'; + /** @return array */ protected function rules(): array { return [ @@ -62,10 +63,10 @@ class EditMemberRole extends ModalComponent private function authorizeWorkspace(int $workspaceId): void { - Workspace::where("id", $workspaceId) + Workspace::where('id', $workspaceId) ->where(fn ($q) => $q - ->where("owner_id", auth()->id()) - ->orWhereHas("members", fn ($q) => $q->where("user_id", auth()->id())) + ->where('owner_id', auth()->id()) + ->orWhereHas('members', fn ($q) => $q->where('user_id', auth()->id())) )->firstOrFail(); } } diff --git a/app/Livewire/Modals/EditQrCode.php b/app/Livewire/Modals/EditQrCode.php index 62961cb..1f9c06f 100644 --- a/app/Livewire/Modals/EditQrCode.php +++ b/app/Livewire/Modals/EditQrCode.php @@ -4,6 +4,7 @@ namespace App\Livewire\Modals; use App\Domains\QrCode\Models\QrCode; use App\Domains\Workspace\Models\Workspace; +use App\Livewire\Pages\QrCodes\Index; use Illuminate\View\View; use LivewireUI\Modal\ModalComponent; @@ -32,6 +33,7 @@ class EditQrCode extends ModalComponent $this->type = $qr->type; } + /** @return array */ protected function rules(): array { return [ @@ -54,7 +56,7 @@ class EditQrCode extends ModalComponent 'payload' => ['url' => $this->url], ]); - $this->dispatch('qr-updated')->to(\App\Livewire\Pages\QrCodes\Index::class); + $this->dispatch('qr-updated')->to(Index::class); $this->dispatch('toast', message: 'QR Code aktualisiert', type: 'success'); $this->closeModal(); } @@ -71,10 +73,10 @@ class EditQrCode extends ModalComponent private function authorizeWorkspace(int $workspaceId): void { - Workspace::where("id", $workspaceId) + Workspace::where('id', $workspaceId) ->where(fn ($q) => $q - ->where("owner_id", auth()->id()) - ->orWhereHas("members", fn ($q) => $q->where("user_id", auth()->id())) + ->where('owner_id', auth()->id()) + ->orWhereHas('members', fn ($q) => $q->where('user_id', auth()->id())) )->firstOrFail(); } } diff --git a/app/Livewire/Modals/InviteMember.php b/app/Livewire/Modals/InviteMember.php index dd85759..b02a91d 100644 --- a/app/Livewire/Modals/InviteMember.php +++ b/app/Livewire/Modals/InviteMember.php @@ -18,6 +18,7 @@ class InviteMember extends ModalComponent public string $role = 'editor'; + /** @return array */ protected function rules(): array { return [ diff --git a/app/Livewire/Modals/UtmBuilder.php b/app/Livewire/Modals/UtmBuilder.php index 33a6d7d..140f34f 100644 --- a/app/Livewire/Modals/UtmBuilder.php +++ b/app/Livewire/Modals/UtmBuilder.php @@ -5,13 +5,19 @@ namespace App\Livewire\Modals; use Illuminate\View\View; use LivewireUI\Modal\ModalComponent; +/** @property-read string $fullUrl */ class UtmBuilder extends ModalComponent { public string $baseUrl = ''; + public string $utmSource = ''; + public string $utmMedium = ''; + public string $utmCampaign = ''; + public string $utmContent = ''; + public string $utmTerm = ''; public bool $copied = false; @@ -36,7 +42,7 @@ class UtmBuilder extends ModalComponent $sep = str_contains($this->baseUrl, '?') ? '&' : '?'; - return $this->baseUrl . $sep . http_build_query($params); + return $this->baseUrl.$sep.http_build_query($params); } public function copyToClipboard(): void diff --git a/resources/views/components/sidebar.blade.php b/resources/views/components/sidebar.blade.php index 3a63e30..2836995 100644 --- a/resources/views/components/sidebar.blade.php +++ b/resources/views/components/sidebar.blade.php @@ -98,10 +98,13 @@