将 Laravel Jetstream 个人资料照片组件移动到不同的视图

问题描述 投票:0回答:1

我正在使用 Laravel Jetstream 构建一个 Web 应用程序:我已将 [配置文件信息(第 1 部分)] (https://jetstream.laravel.com/3.x/features/profile-management.html) 部分移至用户个人资料,用户可以通过移动将个人资料照片上传到不同的视图

@if (Laravel\Fortify\Features::canUpdateProfileInformation())
  @livewire('profile.update-profile-information-form')  
  <x-section-border />
@endif

到我的自定义视图。

一切正常,但我无法弄清楚重定向!每当我更新个人资料照片并保存时,它都会重定向回个人资料视图而不是我的自定义视图

但是,当我更新电子邮件或姓名时,它会保留在我的自定义视图中

问题:我可以在哪里更新重定向以便它重定向到我的自定义视图?

我检查了文档中所述的

\app\Actions\Fortify\UpdateUserProfileInformation.php
,但它没有任何重定向。

php laravel fortify laravel-jetstream
1个回答
-1
投票

我明白了:你需要更新

\vendor\Laravel\jetstream\src\Http\Livewire\UpdateProfileInformationForm.php

public function updateProfileInformation(UpdatesUserProfileInformation $updater)
{
    $this->resetErrorBag();

    $updater->update(
        Auth::user(),
        $this->photo
            ? array_merge($this->state, ['photo' => $this->photo])
            : $this->state
    );

    if (isset($this->photo)) {
        return redirect()->route('basicinfo');
    }

    $this->emit('saved');

    $this->emit('refresh-navigation-menu');
}
© www.soinside.com 2019 - 2024. All rights reserved.