daniel-de-wit / nova-paperclip
Laravel Nova fields for laravel-paperclip attachments.
Installs: 42 795
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 5
Forks: 2
Open Issues: 1
Requires
- php: ^7.2.5 || ^8.0
- cakephp/chronos: ^2.0
- czim/laravel-paperclip: ^3.0 || ^4.0 || ^5.0
- laravel/framework: ^8.74 || ^9.0 || ^10.0
- laravel/nova: ^3.0 || ^4.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- nunomaduro/larastan: ^1.0 || ^2.0
- orchestra/testbench: ^6.7 || ^7.0 || ^8.0
- phpstan/phpstan-mockery: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5 || ^10.0
- thecodingmachine/phpstan-safe-rule: ^1.0
This package is auto-updated.
Last update: 2024-11-06 13:05:38 UTC
README
Laravel Nova fields for laravel-paperclip attachments.
Installation
composer require daniel-de-wit/nova-paperclip
Fields
- PaperclipFile
- PaperclipImage
Usage
Add to Nova resource
<?php namespace App\Nova; use DanielDeWit\NovaPaperclip\PaperclipImage; class MyResource extends Resource { public function fields(Request $request): array { return [ PaperclipImage::make('My Paperclip Image', 'image') ->mimes(['png']) ->width(1080) ->height(1080) ->rules( 'required', 'mimetypes:image/png', 'mimes:png', 'dimensions:width=1080,height=1080' ), ]; } }
The extra methods such as width()
and height()
are currently only used for display. Rules should still be set manually.