https://github.com/fxcjahid/laravel-editor-js
https://github.com/fxcjahid/laravel-editor-js
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/fxcjahid/laravel-editor-js
- Owner: fxcjahid
- License: mit
- Created: 2022-12-23T09:07:40.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-23T11:52:17.000Z (almost 3 years ago)
- Last Synced: 2025-06-30T23:41:55.719Z (3 months ago)
- Language: PHP
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel Editor JS
## Install
1. Install package
```composer require zencoreitservices/laravel-editor-js```
2. Add provider in `config/app.php`
```LaravelEditorJs\LaravelEditorJsProvider::class```
## Configuration
Publish config
```artisan vendor:publish --tag=laravel-editor-js-config```
Publish views
```artisan vendor:publish --tag=laravel-editor-js-views```
Publish translation
```artisan vendor:publish --tag=laravel-editor-js-lang```
Add routes
```php
Route::get('/fetch-url', function(\Illuminate\Http\Request $request){
return response()->json(LaravelEditorJs\Misc\UrlFetcher::fetch($request));
});
Route::post('/upload-file', function(\Illuminate\Http\Request $request){
return response()->json(LaravelEditorJs\Misc\FileUpload::upload($request));
});
Route::post('/fetch-url-image', function(\Illuminate\Http\Request $request){
return response()->json(LaravelEditorJs\Misc\FileUpload::fetchImage($request));
});
```## Usage
Convert blocks into HTML
```php
$blocksManager = new \LaravelEditorJs\BlocksManager($data);
$html = $blocksManager->renderHtml();
```