{"id":18973678,"url":"https://github.com/64robots/nova-image-cropper","last_synced_at":"2026-04-08T00:30:19.906Z","repository":{"id":32934799,"uuid":"146911122","full_name":"64robots/nova-image-cropper","owner":"64robots","description":"Image Field with built-in cropper for Laravel Nova","archived":false,"fork":false,"pushed_at":"2023-03-04T03:29:51.000Z","size":2139,"stargazers_count":57,"open_issues_count":20,"forks_count":16,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T12:29:56.460Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/64robots.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["beliolfa"]}},"created_at":"2018-08-31T15:36:50.000Z","updated_at":"2023-11-16T10:23:26.000Z","dependencies_parsed_at":"2024-06-19T02:56:19.998Z","dependency_job_id":null,"html_url":"https://github.com/64robots/nova-image-cropper","commit_stats":{"total_commits":43,"total_committers":6,"mean_commits":7.166666666666667,"dds":0.5116279069767442,"last_synced_commit":"efba771c7a80327b24e1f925602aa564ea0a5df5"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/64robots%2Fnova-image-cropper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/64robots%2Fnova-image-cropper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/64robots%2Fnova-image-cropper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/64robots%2Fnova-image-cropper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/64robots","download_url":"https://codeload.github.com/64robots/nova-image-cropper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239970677,"owners_count":19727014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T15:12:49.520Z","updated_at":"2026-04-08T00:30:19.829Z","avatar_url":"https://github.com/64robots.png","language":"Vue","funding_links":["https://github.com/sponsors/beliolfa"],"categories":[],"sub_categories":[],"readme":"# Image Field with built-in cropper for Laravel Nova\n\nThis field extends Image Field adding a handy cropper to manipulate images. Can be configurable in the same way as a [File field in Nova](https://nova.laravel.com/docs/1.0/resources/file-fields.html).\n\n### Demo\n\n![Demo](http://g.recordit.co/9ubWDbqNNL.gif)\n\n### Install\n\nRun this command into your nova project:\n`composer require r64/nova-image-cropper`\n\n### Add it to your Nova Resource:\n\n```php\nuse R64\\NovaImageCropper\\ImageCropper;\n\nImageCropper::make('Photo'),\n```\n\n### Update form\n\nIn order to edit the existing image saved in the model, ImageCroper uses the preview method to return a base64 encoded image. You can either use the default implementation or override it as long as you return a base64 image.\n\n```php\nuse R64\\NovaImageCropper\\ImageCropper;\n\nImageCropper::make('Photo')\n        -\u003epreview(function () {\n            if (!$this-\u003evalue) return null;\n\n            $url = Storage::disk($this-\u003edisk)-\u003eurl($this-\u003evalue);\n            $filetype = pathinfo($url)['extension'];\n            return 'data:image/' . $filetype . ';base64,' . base64_encode(file_get_contents($url));\n        });\n```\n\n### Options\n\n#### Avatar mode\n\nYou can add a rounded mask to the preview and the cropper\n\n```php\nImageCropper::make('Photo')-\u003eavatar()\n```\n\n#### Custom aspect ratio\n\nDefine the fixed aspect ratio of the crop box.\n\n- Type: Number\n- Default: NaN\n\n```php\nImageCropper::make('Photo')-\u003easpectRatio(16/9)\n```\n\nFor free ratio use:\n\n```php\nImageCropper::make('Photo')-\u003easpectRatio(0)\n```\n\n### Localization\n\nSet your translations in the corresponding xx.json file located in `/resources/lang/vendor/nova`\n\n```php\n...\n\n  \"Edit Image\": \"Editar Imagen\",\n  \"Cancel Crop\": \"Cancelar Recorte\",\n  \"Change Image\": \"Cambiar Imagen\",\n  \"Done\": \"Hecho\",\n  \"Click here or drop the file to upload\": \"Click aquí o arrastra el archivo para comenzar la subida\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F64robots%2Fnova-image-cropper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F64robots%2Fnova-image-cropper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F64robots%2Fnova-image-cropper/lists"}