Here is the source code for the trait HasProfilePhoto which jetstream uses to handle the profile photo logic.
https://github.com/laravel/jetstream/blob/master/src/HasProfilePhoto.php
you can add these two methods to User model (and modify them to match your code) :
/**
* Get the URL to the user's profile photo.
*
* @return string
*/
public function getProfilePhotoUrlAttribute()
{
return $this->profile_photo_path
? Storage::disk("public")->url($this->profile_photo_path)
: $this->defaultProfilePhotoUrl();
}
/**
* Get the default profile photo URL if no profile photo has been uploaded.
*
* @return string
*/
protected function defaultProfilePhotoUrl()
{
$name = trim(collect(explode(' ', $this->name))->map(function ($segment) {
return $segment[0] ?? '';
})->join(' '));
return 'https://ui-avatars.com/api/?name='.urlencode($name).'&color=7F9CF5&background=EBF4FF';
}
make sure that you append profile_photo_path to user model and to users database table. then you can use the photo like: <img src="auth()->user()->profile_photo_url" />