LaravelPackages.net
Acme Inc.
Toggle sidebar
expdev07/nova-slim-field

Laravel Nova field for cropping images using the "Slim Image Cropper" (https://pqina.nl/slim/). This is an alternative to Doka (now Pintura) for those who want a less expensive cropping experience.

49
4
v1.0.1
About expdev07/nova-slim-field

expdev07/nova-slim-field is a Laravel package for laravel nova field for cropping images using the "slim image cropper" (https://pqina.nl/slim/). this is an alternative to doka (now pintura) for those who want a less expensive cropping experience.. It currently has 4 GitHub stars and 49 downloads on Packagist (latest version v1.0.1). Install it with composer require expdev07/nova-slim-field. Discover more Laravel packages by expdev07 or browse all Laravel packages to compare alternatives.

Last updated

Nova Slim Field

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

This package adds a new Laravel Nova field for cropping images using the "Slim Image Cropper" (https://pqina.nl/slim/). This is an alternative to Doka (now Pintura) for those who want a less expensive cropping experience.

Install

Composer install the package:

composer require expdev07/nova-slim-field

Publish the config:

php artisan vendor:publish --provider="ExpDev07\NovaSlimField\SlimFieldServiceProvider" --tag="config"

Configure the Slim assets:

/**
 * Configure the path to the slim assets.
 */
'slim' => [
    'jquery' => public_path('/js/jquery.js'),
    'js' => public_path('/js/slim.js'),
    'css' => public_path('/css/slim.css'),
]

Using

Slim extends the Image Field, so you have all your normal options such as deciding how to store the image.

/**
 * Get the fields displayed by the resource.
 *
 * @param Request $request
 * @return array
 */
public function fields(Request $request): array
{
    return [
        Slim::make('Featured Image')->cropable(true)->ratio('1:1')->size('300,300'),
    ];
}

Thanks to

  • ExpDev07 - Creator and maintainer.
  • ... All the creators and maintainers of Nova.

Screenshots

Empty state

Image uploaded

Cropping image

Image cropped

Star History Chart