Preview
Usage
Props
Model
required
The user model instance. Must have
picture and full_name attributes.bool
default:"true"
Whether to display the user’s name next to the avatar.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Display user profile picture with optional name
<x-shopper::user-avatar :user="$customer" />
picture and full_name attributes.<x-shopper::user-avatar :user="$user" />
<x-shopper::user-avatar :user="$user" :showName="false" />
Tables\Columns\ViewColumn::make('customer')
->view('shopper::components.user-avatar')
->label(__('Customer')),
public function getPictureAttribute(): string;
public function getFullNameAttribute(): string;
@props([
'user',
'showName' => true,
])
<div class="flex items-center gap-2">
<img
class="size-8 rounded-full"
src="{{ $user->picture }}"
alt="{{ $user->full_name }}"
/>
@if ($showName)
<span class="text-sm font-medium text-gray-700 dark:text-gray-300">
{{ $user->full_name }}
</span>
@endif
</div>