File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed
Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Unisharp \Laravelfilemanager \Events ;
4+
5+ class FolderWasRenamed
6+ {
7+ private $ path ;
8+
9+ public function __construct ($ old_path , $ new_path )
10+ {
11+ $ this ->old_path = $ old_path ;
12+ $ this ->new_path = $ new_path ;
13+ }
14+
15+ /**
16+ * @return string
17+ */
18+ public function old_path ()
19+ {
20+ return $ this ->old_path ;
21+ }
22+
23+ public function new_path ()
24+ {
25+ return $ this ->new_path ;
26+ }
27+
28+ }
Original file line number Diff line number Diff line change 88use Illuminate \Support \Str ;
99use Lang ;
1010use Unisharp \Laravelfilemanager \Events \ImageWasRenamed ;
11+ use Unisharp \Laravelfilemanager \Events \FolderWasRenamed ;
1112
1213/**
1314 * Class RenameController
@@ -39,10 +40,9 @@ public function getRename()
3940 return Lang::get ('laravel-filemanager::lfm.error-rename ' );
4041 }
4142
42- Event::fire (new ImageWasRenamed ($ old_file , $ new_file ));
43-
4443 if (File::isDirectory ($ old_file )) {
4544 File::move ($ old_file , $ new_file );
45+ Event::fire (new FolderWasRenamed ($ old_file , $ new_file ));
4646 return 'OK ' ;
4747 }
4848
@@ -52,6 +52,8 @@ public function getRename()
5252 File::move ($ thumb_path . $ old_name , $ thumb_path . $ new_name );
5353 }
5454
55+ Event::fire (new ImageWasRenamed ($ old_file , $ new_file ));
56+
5557 return 'OK ' ;
5658 }
5759}
You can’t perform that action at this time.
0 commit comments