File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed
Console/Commands/Teamspeak Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ public function handle()
29
29
{
30
30
31
31
$ tscon = TeamSpeak::run ('ZTL Management Bot ' );
32
+ $ clients = $ tscon ->clientList ();
32
33
foreach ($ clients as $ client ) {
33
34
$ member = TeamSpeak::checkClientRegistration ($ client );
34
35
Original file line number Diff line number Diff line change @@ -112,11 +112,13 @@ public function teamspeak() {
112
112
public function newProfilePic () {
113
113
return view ('site.upload ' );
114
114
}
115
- public function edit () {
116
- $ id = Auth::id ();
117
- $ file_path = app_path ("/storage/files/ " , $ id , '.jpg ' ); // app_path("public/test.txt");
118
- if (File::exists ($ file_path )) File::delete ($ file_path );
119
-
115
+
116
+ public function edit ($ id ) {
117
+ $ file = File::find ($ id );
118
+ $ file_path = $ file ->path ;
119
+ $ file_name = $ file ->name ;
120
+ unlink ('/storage/app/public/ ' .$ file_name .'.jpg ' );
121
+ $ file ->delete ();
120
122
}
121
123
122
124
@@ -137,9 +139,9 @@ public function sFile(Request $request) {
137
139
138
140
139
141
$ path = $ request ->file ('file ' )->storeAs (
140
- '/public/files ' , $ name
142
+ '/public/files/ ' , $ name
141
143
);
142
- $ public_url = '/storage/files ' .$ name ;
144
+ $ public_url = '/storage/files/ ' .$ name ;
143
145
$ file = new File ;
144
146
$ file ->path = $ public_url ;
145
147
$ file ->save ();
Original file line number Diff line number Diff line change 32
32
Route::post ('/feedback/new ' , 'FrontController@saveNewFeedback ' );
33
33
Route::get ('/profile_pic ' , 'FrontController@newProfilePic ' );
34
34
Route::post ('/profile_pic ' , 'FrontController@sFile ' );
35
- Route::get ('/edit_pic ' , 'FrontController@edit ' );
36
- Route::post ('/edit_pic ' , 'FrontController@eFile ' );
35
+ Route::get ('/edit_pic/{id} ' , 'FrontController@edit ' );
36
+ Route::post ('/edit_pic/{id} ' , 'FrontController@eFile ' );
37
37
Route::get ("/admin " , function (){
38
38
return View::make ("admin " );
39
39
});
You can’t perform that action at this time.
0 commit comments