feat:invitation email for shared portfolios

This commit is contained in:
hackerESQ
2024-10-22 17:39:42 -05:00
parent d1dbf3af62
commit 5756fa06d7
4 changed files with 73 additions and 4 deletions
@@ -1,7 +1,7 @@
@props(['title' => ''])
<div {{ $attributes->merge(['class' => 'flex items-center mb-6']) }} class="">
<h1 class="text-2xl font-medium mr-3"> {{ $title }} </h1>
<h1 class="text-2xl font-medium mr-3 truncate"> {{ $title }} </h1>
{{ $slot }}
</div>
@@ -6,6 +6,7 @@ use Livewire\Attributes\Rule;
use Livewire\Volt\Component;
use Illuminate\Support\Collection;
use Mary\Traits\Toast;
use App\Notifications\InvitedToPortfolioNotification;
new class extends Component {
@@ -99,7 +100,14 @@ new class extends Component {
'full_access' => $this->fullAccess
];
$this->portfolio->users()->sync($this->permissions);
$sync = $this->portfolio->users()->sync($this->permissions);
if (!empty($sync['attached'])) {
foreach($sync['attached'] as $newUserId) {
User::find($newUserId)->notify(new InvitedToPortfolioNotification($this->portfolio, auth()->user()));
};
}
$this->success(__('Shared portfolio with user'));
$this->portfolio->refresh();
@@ -233,6 +241,5 @@ new class extends Component {
<x-button class="btn-sm block mt-4" @click="$dispatch('toggle-add-user-modal')">
{{ __('Add People') }}
</x-button>
</div>
</div>
+1 -1
View File
@@ -37,7 +37,7 @@
{{-- Salutation --}}
@if (! empty($salutation))
{{ $salutation }}
{!! nl2br($salutation) !!}
@else
@lang('Regards,')<br>
{{ config('app.name') }}