Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
wangta69 committed Sep 13, 2024
1 parent f494370 commit da18926
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 2 deletions.
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,38 @@
# NAVER SMART Editor for Laravel

## document

[공식사이트](https://www.onstory.fun/doc/programming/laravel/package.laraveleditor)


## document
## Installation
```
composer require wangta69/laravel-editor
php artisan editor:install
```

## Tests
> goto https://yourdomain/editor/smart-editor

## Ex
### before
```
<form>
<textarea name="comment"></textarea>
<button type="submit">Save</button>
</form>
```
### after
```
<form>
@include ('editor::smart-editor.editor', ['name'=>'comment', 'id'=>'comment-id', 'value'=>'', 'attr'=>['class'=>'']])
<button type="submit">Save</button>
</form>
```
![laravel WYSIWYG editor](./resources/assets/editor-sample.png)

- for more [visit](https://www.onstory.fun/doc/programming/laravel/package.laraveleditor)


[공식사이트](https://www.onstory.fun/doc/programming/laravel/package.laraveleditor)
53 changes: 53 additions & 0 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

namespace Pondol\Editor\Console;

use Illuminate\Console\Command;
// use Illuminate\Filesystem\Filesystem;
// use Illuminate\Support\Str;
// use Symfony\Component\Process\PhpExecutableFinder;
// use Symfony\Component\Process\Process;

class InstallCommand extends Command
{
// use InstallsBladeStack;

/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'editor:install';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Install the Laravel Editor controllers and resources';


public function __construct()
{
parent::__construct();
}

public function handle()
{
return $this->installLaravelEditor();
}


private function installLaravelEditor()
{

\Artisan::call('storage:link');
\Artisan::call('vendor:publish', [
'--force'=> true,
'--provider' => 'Pondol\Editor\EditorServiceProvider'
]);
$this->info('The laravel editor installed successfully.');
}


}
7 changes: 7 additions & 0 deletions src/EditorServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ class EditorServiceProvider extends ServiceProvider {
*/
public function register()
{

if ($this->app->runningInConsole()) {
$this->commands([
Console\InstallCommand::class,
// Console\InstallCommand::class,
]);
}
// $this->app->bind('editor', function($app) {
$this->app->singleton('editor', function($app) {
return new Editor;
Expand Down
Binary file added src/resources/assets/images/editor-sample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit da18926

Please sign in to comment.