georgeboot / laravel-tiptap
使用 TALL stack 的 Tiptap 编辑器的有观点集成
0.1.1
2023-02-22 08:08 UTC
Requires
- php: ^8.0
- ext-json: *
- aws/aws-sdk-php: ^3.80
- laravel/framework: ^6.0|^7.0|^8.0|^9.0|^10.0
- spatie/invade: ^1.1
Requires (Dev)
- mockery/mockery: ^1.2
- nunomaduro/larastan: ^2.4
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.0
- phpunit/phpunit: ^8.0|^9.0
README
composer require georgeboot/laravel-tiptap
yarn add laravel-tiptap
在你的 app.js
import Alpine from 'alpinejs' import LaravelTiptap from 'laravel-tiptap' // add this Alpine.data('tiptapEditor', LaravelTiptap) // add this Alpine.start()
在你的 blade 文件中
<x-tiptap-editor /> <!-- enable image upload --> <x-tiptap-editor enable-image-upload />
图片上传
确保你在 s3 中正确配置了 s3 磁盘
// config/filesystems.php <?php return [ // other settings 'disks' => [ // other disks 's3' => [ 'driver' => 's3', 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'token' => env('AWS_SESSION_TOKEN'), 'region' => env('AWS_DEFAULT_REGION'), 'bucket' => env('AWS_BUCKET'), 'url' => env('AWS_URL'), // 'url' => 'https://my-cloudfront-id.cloudfront.net', // optional: if you use cloudfront or some other cdn in front of s3 'endpoint' => env('AWS_ENDPOINT'), ], // ... ], ];
将 purge 目录添加到 TailwindCSS 配置
module.exports = { purge: [ // your existing purges './vendor/georgeboot/laravel-tiptap/resources/views/**/*.blade.php', ], }