Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/expdev07/nova-slim-field
🖼️ Laravel Nova Field for uploading and cropping images using "Slim Image Cropper" (https://pqina.nl/slim/).
https://github.com/expdev07/nova-slim-field
crop doka field image nova pintura
Last synced: about 1 month ago
JSON representation
🖼️ Laravel Nova Field for uploading and cropping images using "Slim Image Cropper" (https://pqina.nl/slim/).
- Host: GitHub
- URL: https://github.com/expdev07/nova-slim-field
- Owner: ExpDev07
- Created: 2022-02-03T14:11:06.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-06T14:11:14.000Z (almost 3 years ago)
- Last Synced: 2023-12-16T15:14:55.602Z (about 1 year ago)
- Topics: crop, doka, field, image, nova, pintura
- Language: PHP
- Homepage:
- Size: 535 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Nova Slim Field[![Latest Stable Version](http://poser.pugx.org/expdev07/nova-slim-field/v)](https://packagist.org/packages/expdev07/nova-slim-field) [![Total Downloads](http://poser.pugx.org/expdev07/nova-slim-field/downloads)](https://packagist.org/packages/expdev07/nova-slim-field) [![Latest Unstable Version](http://poser.pugx.org/expdev07/nova-slim-field/v/unstable)](https://packagist.org/packages/expdev07/nova-slim-field) [![License](http://poser.pugx.org/expdev07/nova-slim-field/license)](https://packagist.org/packages/expdev07/nova-slim-field) [![PHP Version Require](http://poser.pugx.org/expdev07/nova-slim-field/require/php)](https://packagist.org/packages/expdev07/nova-slim-field)
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:
```php
/**
* 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.
```php
/**
* 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