File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Unisharp \Laravelfilemanager \Events ;
4+
5+ class ImageWasUploaded
6+ {
7+ private $ path ;
8+
9+ public function __construct ($ path )
10+ {
11+ $ this ->path = $ path ;
12+ }
13+
14+ /**
15+ * @return string
16+ */
17+ public function path ()
18+ {
19+ return $ this ->path ;
20+ }
21+
22+ }
Original file line number Diff line number Diff line change 11<?php namespace Unisharp \Laravelfilemanager \controllers ;
22
3+ use Illuminate \Support \Facades \Event ;
34use Unisharp \Laravelfilemanager \controllers \Controller ;
45use Illuminate \Support \Facades \Config ;
56use Illuminate \Support \Facades \File ;
89use Lang ;
910use Intervention \Image \Facades \Image ;
1011use Symfony \Component \HttpFoundation \File \UploadedFile ;
12+ use Unisharp \Laravelfilemanager \Events \ImageWasUploaded ;
1113
1214/**
1315 * Class UploadController
@@ -51,6 +53,8 @@ public function upload()
5153 $ this ->makeThumb ($ dest_path , $ new_filename );
5254 }
5355
56+ Event::fire (new ImageWasUploaded (realpath ($ dest_path .'/ ' .$ new_filename )));
57+
5458 // upload via ckeditor 'Upload' tab
5559 if (!Input::has ('show_list ' )) {
5660 return $ this ->useFile ($ new_filename );
You can’t perform that action at this time.
0 commit comments