Skip to content

kitamula/ckeditor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CKEditor 5 for laravel-admin

Installation

composer require kitamula/ckeditor

Then

php artisan vendor:publish --tag=kitamula-ckeditor

Configuration

In the extensions section of the config/admin.php file, add some configuration that belongs to this extension.

    'ckeditor' => [
    		
    		    //Set to false if you want to disable this extension
    		    'enable' => true,
    		
    		    // Editor configuration
    		    'config' => [
    			   "simpleUpload"=>[
    			   	    "uploadUrl"=>'/admin/uploads'
    			   ],
    			    "fontSize" => [
    			    	"options" =>[
    					    9,
    					    11,
    					    13,
    					    'default',
    					    17,
    					    19,
    					    21
    				    ]
    			    ],
    			    "toolbar"=>[
    			    	"items"=>[
    					    'heading',
    					    'fontFamily',
    					    'fontSize',
    					    'fontColor',
    					    'fontBackgroundColor',
    					    'bold',
    					    'italic',
    					    'link',
    					    'bulletedList',
    					    'numberedList',
    					    '|',
    					    'indent',
    					    'outdent',
    					    '|',
    					    'imageUpload',
    					    'blockQuote',
    					    'insertTable',
    					    'mediaEmbed',
    					    'undo',
    					    'redo'
    				    ]
    			    ],
    			    'image'=>[
    			    	'toolbar'=>['imageTextAlternative', '|', 'imageStyle:alignLeft', 'imageStyle:full', 'imageStyle:alignRight'],
    				    'resizeUnit'=>'px',
    				    'styles'=>[
    					    // This option is equal to a situation where no style is applied.
    					    'full',
    					
    					    'side',
    					    // This represents an image aligned to the left.
    					    'alignLeft',
    					    'alignCenter',
    					    // This represents an image aligned to the right.
    					    'alignRight'
    				    ]
    			    ],
    			    
    			    "table" =>[
    			    	'contentToolbar'=>[
    					    'tableColumn',
    					    'tableRow',
    					    'mergeTableCells'
    				    ]
    			    ],
    			    'language'=>'ja',
    		    
    		    ]
    	    ]

Usage

Add the following code to app/Admin/bootstrap.php

Encore\Admin\Form::extend('editor', \kitamula\CKEditor\Editor::class);

About

CKEditor 5 集成laravel-admin

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CSS 73.2%
  • PHP 16.0%
  • HTML 6.9%
  • Blade 3.9%