安装教程中有答案。
https://jetstream.laravel.com/1.x/installation.html#application-logo
php artisan vendor:publish --tag=jetstream-views
Livewire
接下来,您应该自定义位于resources/views/vendor/jetstream/components/application-logo.blade.php、resources/views/vendor/jetstream/components/authentication-card-logo.blade.php和resources/views/vendor/jetstream/components/application-mark.blade.php组件中的SVG。
Inertia
接下来,您应该自定义位于resources/views/vendor/jetstream/components/authentication-card-logo.blade.php、resources/js/Jetstream/ApplicationLogo.vue和resources/js/Jetstream/ApplicationMark.vue中的SVG。在自定义这些组件后,您应该重新构建资产:
我找到了这个,按照以下步骤操作。
您可以运行以下命令来发布资源。
php artisan vendor:publish --tag=jetstream-views
之后,文件将可在文件夹 resources/views/vendor/jetstream/components
下找到。
只需添加您自己的html标记。
像这样操作:
<x-slot name="logo">
<img src="{{ url('logo.png') }}" />
</x-slot>
php artisan vendor:publish --tag=jetstream-views
。然后,您需要获取resources\views\auth\login.blade.php
并将其替换为您自己的组件<x-jet-authentication-card-logo />
。php artisan make:component AppLogo
并创建自己的组件来实现这一点。请注意保留html标签。<?php
namespace App\View\Components;
use App\Models\GeneralSettings;
use Illuminate\View\Component;
class AppLogo extends Component
{
public $logo;
public function __construct()
{
$this->logo = GeneralSettings::first()->favicon;
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|string
*/
public function render()
{
return view('components.home.app-logo');
}
}
之后,您需要编辑resources\views\components\home\app-logo.blade.php
文件,如下所示:
<div>
<img src="{{$logo}}">
</div>
接下来,您需要获取resources\views\auth\login.blade.php
文件,并将其中的<x-jet-authentication-card-logo />
替换为您自己的组件!就像这样:<x-applogo />
结果应该如下所示:
<x-guest-layout>
<x-jet-authentication-card>
<x-slot name="logo">
{{-- <x-jet-authentication-card-logo />--}}
<x-applogo />
</x-slot>
<x-jet-validation-errors class="mb-4" />
....