PHP code example of wangta69 / laravel-editor
1. Go to this page and download the library: Download wangta69/laravel-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/ */
wangta69 / laravel-editor example snippets
use Pondol\Editor\Traits\SmartEditor;
class PostController extends Controller
{
use SmartEditor;
public function uploadImage(Request $request)
{
// _uploadStore 메서드가 유효성 검사 및 저장을 자동으로 처리합니다.
// 두 번째 인자로 storage/app/public 하위의 저장 경로를 지정할 수 있습니다.
$result = $this->_uploadStore($request, 'uploads/posts');
if ($result['error']) {
return response()->json(['success' => false, 'message' => 'Upload failed']);
}
return $result['url'];
}
}
bash
php artisan pondol:install-editor