Skip to content

Commit 8bc1117

Browse files
author
itsbenny99
committed
#4 #5
1 parent e322f37 commit 8bc1117

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

app/Console/Commands/Teamspeak/TeamSpeakManager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function handle()
2929
{
3030

3131
$tscon = TeamSpeak::run('ZTL Management Bot');
32+
$clients = $tscon->clientList();
3233
foreach ($clients as $client) {
3334
$member = TeamSpeak::checkClientRegistration($client);
3435

app/Http/Controllers/FrontController.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,13 @@ public function teamspeak() {
112112
public function newProfilePic() {
113113
return view('site.upload');
114114
}
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();
120122
}
121123

122124

@@ -137,9 +139,9 @@ public function sFile(Request $request) {
137139

138140

139141
$path = $request->file('file')->storeAs(
140-
'/public/files', $name
142+
'/public/files/', $name
141143
);
142-
$public_url = '/storage/files'.$name;
144+
$public_url = '/storage/files/'.$name;
143145
$file = new File;
144146
$file->path = $public_url;
145147
$file->save();

routes/web.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
Route::post('/feedback/new', 'FrontController@saveNewFeedback');
3333
Route::get('/profile_pic', 'FrontController@newProfilePic');
3434
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');
3737
Route::get("/admin", function(){
3838
return View::make("admin");
3939
});

0 commit comments

Comments
 (0)