기본 그라바타로 사진을 불러오게 되어있다.

https://ko.gravatar.com/

여기에 있는 이미지가 이메일주소로 연동되어서 이미지사진이 불러오는 방식인가보다

난 이것을 사용하지 않을 것이다.


기본 아래와 같이 되어있다.

1
Gravatar::make()->maxWidth(150),
cs


1. 위 소스를 삭제하고 필드를 만들어준다.

1
 Avatar::make('사진','id_photo')->maxWidth(150),
cs


2. users테이블에  id_photo 컬럼을 만들어주자


3.resources/views/vendor/nova/partials/user.blade.php 파일을 수정해주자

5번째 줄처럼 경로를 바꿔주자 유저의 id_photo가 들어오게 수정해주자

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<dropdown-trigger class="h-9 flex items-center">
    @isset($user->email)
 
        <img src="{{ asset(auth()->user()->id_photo) }}"   class="rounded-full w-8 h-8 mr-3">
        
    @endisset
 
    <span class="text-90">
        {{ $user->name ?? $user->email ?? __('Nova User') }}
    </span>
</dropdown-trigger>
 
<dropdown-menu slot="menu" width="200" direction="rtl">
    <ul class="list-reset">
        <li>
            <a href="#" class="block no-underline text-90 hover:bg-30 p-3">
                Custom Link
            </a>
 
            <a href="{{ route('nova.logout') }}" class="block no-underline text-90 hover:bg-30 p-3">
                {{ __('Logout') }}
            </a>
        </li>
    </ul>
</dropdown-menu>
 
cs


that's great


'라라벨 > NOVA' 카테고리의 다른 글

nova tiny 패키지 설치  (0) 2020.01.05
(package) nova filemanager 파일관리자  (0) 2020.01.05
글로벌 검색 왼쪽 laravel 변경하기  (0) 2020.01.05
Resources 제목 변경하기  (0) 2020.01.05
nova 사용자 정의 필드만들기  (0) 2020.01.04

+ Recent posts