| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function save(Request $request) |
||
| 33 | { |
||
| 34 | // Get All Inputs Except '_Token' to loop through and save |
||
| 35 | $settings = $request->except('_token'); |
||
| 36 | |||
| 37 | // Update All Settings |
||
| 38 | foreach ($settings as $key => $value) { |
||
| 39 | |||
| 40 | if ($key == "gym_logo") |
||
| 41 | { |
||
| 42 | \Utilities::uploadFile($request,'', $key,'gym_logo',\constPaths::GymLogo); // Upload File |
||
| 43 | $value = $key.'.jpg'; // Image Name For DB |
||
| 44 | } |
||
| 45 | |||
| 46 | Setting::where('key', '=',$key)->update(['value' => $value ]); |
||
| 47 | } |
||
| 48 | |||
| 49 | flash()->success('Setting was successfully updated'); |
||
| 50 | return redirect('settings/edit'); |
||
| 51 | } |
||
| 53 | } |