-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
128 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace TyrantG\BraftEditor\Http\Controllers; | ||
|
||
use Illuminate\Http\Request; | ||
use Illuminate\Routing\Controller; | ||
|
||
class BraftEditorController extends Controller | ||
{ | ||
public function upload(Request $request) | ||
{ | ||
$file = $request->file('file')->store('public/braft-files'); | ||
|
||
$url = '/storage/'.str_replace('public/', '', $file); | ||
|
||
return response()->json([ | ||
'return_code' => '200', | ||
'result_code' => 'SUCCESS', | ||
'msg' => '上传成功', | ||
'url' => $url, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Route; | ||
use TyrantG\BraftEditor\Http\Controllers\BraftEditorController; | ||
|
||
Route::any('tyrantg/braft/upload', BraftEditorController::class.'@upload'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,7 @@ | |
'1.0.0' => [ | ||
'Initialize extension.', | ||
], | ||
'1.0.1' => [ | ||
'上传媒体文件', | ||
], | ||
]; |