diff --git a/.env.testing b/.env.testing index 6ca5e072..fc824898 100644 --- a/.env.testing +++ b/.env.testing @@ -1,6 +1,6 @@ APP_NAME=Laravel APP_ENV=local -APP_KEY=base64:YE2Zo20UvRL3LkRLr54PjlayHUCoDEGVICIq76iFZlU= +APP_KEY=base64:yMMyV3sJ87ArJwlbTKlr9O2JBr/eB4w3AEKj3Z1SoPM= APP_DEBUG=true APP_URL=http://localhost APP_DEMO=false diff --git a/src/Domain/Sharing/Actions/SendViaEmailAction.php b/src/Domain/Sharing/Actions/SendViaEmailAction.php index c147dc53..571642dc 100644 --- a/src/Domain/Sharing/Actions/SendViaEmailAction.php +++ b/src/Domain/Sharing/Actions/SendViaEmailAction.php @@ -1,6 +1,7 @@ notify(new SharedSendViaEmail($token)); + ->notify(new SharedSendViaEmail($token, $user)); } } } diff --git a/src/Domain/Sharing/Controllers/ShareController.php b/src/Domain/Sharing/Controllers/ShareController.php index 91789d40..8bc63d80 100644 --- a/src/Domain/Sharing/Controllers/ShareController.php +++ b/src/Domain/Sharing/Controllers/ShareController.php @@ -46,7 +46,8 @@ class ShareController extends Controller if ($request->has('emails')) { $sendLinkToEmailAction->onQueue()->execute( emails: $request->input('emails'), - token: $shared->token + token: $shared->token, + user: $shared->user, ); } diff --git a/src/Domain/Sharing/Controllers/ShareViaEmailController.php b/src/Domain/Sharing/Controllers/ShareViaEmailController.php index 87f05d87..1f16d384 100644 --- a/src/Domain/Sharing/Controllers/ShareViaEmailController.php +++ b/src/Domain/Sharing/Controllers/ShareViaEmailController.php @@ -1,6 +1,7 @@ sendLinkToEmailAction)->onQueue()->execute( emails: $request->input('emails'), token: $token, + user: Auth::user(), ); return response('Done.', 204); diff --git a/src/Domain/Sharing/Notifications/SharedSendViaEmail.php b/src/Domain/Sharing/Notifications/SharedSendViaEmail.php index 6a2d1855..3df54877 100644 --- a/src/Domain/Sharing/Notifications/SharedSendViaEmail.php +++ b/src/Domain/Sharing/Notifications/SharedSendViaEmail.php @@ -1,8 +1,8 @@ token = $token; - $this->user = Auth::user(); - } + public function __construct( + public string $token, + public User $user, + ) {} /** * Get the notification's delivery channels. - * - * @param mixed $notifiable - * @return array */ - public function via($notifiable) + public function via(mixed $notifiable): array { return ['mail']; } /** * Get the mail representation of the notification. - * - * @param mixed $notifiable - * @return \Illuminate\Notifications\Messages\MailMessage */ - public function toMail($notifiable) + public function toMail(mixed $notifiable): MailMessage { return (new MailMessage) ->subject(__t('shared_link_email_subject', ['user' => $this->user->settings->name])) @@ -47,16 +38,4 @@ class SharedSendViaEmail extends Notification ->action(__t('shared_link_email_link'), url('/share', ['token' => $this->token])) ->salutation(__t('shared_link_email_salutation', ['app_name' => get_settings('app_title') ?? 'VueFileManager'])); } - - /** - * Get the array representation of the notification. - * - * @param mixed $notifiable - * @return array - */ - public function toArray($notifiable) - { - return [ - ]; - } } diff --git a/tests/Domain/SetupWizard/SetupWizardTest.php b/tests/Domain/SetupWizard/SetupWizardTest.php index 2ba0bbde..349daa4c 100644 --- a/tests/Domain/SetupWizard/SetupWizardTest.php +++ b/tests/Domain/SetupWizard/SetupWizardTest.php @@ -85,7 +85,7 @@ class SetupWizardTest extends TestCase ]) ->assertDatabaseHas('settings', [ 'name' => 'user_verification', - 'value' => 1, + 'value' => 0, ]) ->assertDatabaseHas('settings', [ 'name' => 'app_color',