64robots / nova-image-cropper

Image Field with built-in cropper for Laravel Nova
57 stars 16 forks source link

Avatar support #1

Closed devmsh closed 6 years ago

devmsh commented 6 years ago

Thanks for the library

Did you plan to support avatar?

beliolfa commented 6 years ago

You can achieve this using an Avatar field for the other views:

ImageCropper::make('Photo')->disk('s3')->onlyOnForms(),
Avatar::make('Photo')->disk('s3')->exceptOnForms(),

This way you see an avatar in detail and index view and you can edit the image in forms

devmsh commented 6 years ago

Why I need to do this nested of having Single Field?

beliolfa commented 6 years ago

Just giving you a quick solution. Of course this field is improvable. We are always willing of hearing request and PRs!

🙌

beliolfa commented 6 years ago

1.0.4 published. Theres no need to use Avatar field when using

ImageCropper::make('Photo')->avatar(),
dddeeemmmooonnn commented 5 years ago

I created new empty custom field that extends ImageCropper and implements Cover:

use Laravel\Nova\Contracts\Cover;
use R64\NovaImageCropper\ImageCropper as R64ImageCropper;

class NovaImageCropper extends R64ImageCropper implements Cover
{

}

avatars are displayed in search