PHP code example of povly / moonshine-image-editor
1. Go to this page and download the library: Download povly/moonshine-image-editor library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
povly / moonshine-image-editor example snippets
use MoonShine\AssetManager\Css;
use MoonShine\AssetManager\Js;
protected function assets(): array
{
return [
...parent::assets(),
Css::make('/vendor/image-editor/image-editor.css'),
Js::make('/vendor/image-editor/filerobot-image-editor.min.js'),
Js::make('/vendor/image-editor/image-editor.js'),
];
}
use MoonShine\UI\Components\FlexibleRender;
use Povly\MoonShineImageEditor\Support\ImageEditorRenderer;
protected function getContentComponents(): array
{
return [
...parent::getContentComponents(),
FlexibleRender::make(
app(ImageEditorRenderer::class)->renderModal(),
),
];
}