Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 17 |
| PlatformSettingController | |
0.00% |
0 / 1 |
|
0.00% |
0 / 4 |
42 | |
0.00% |
0 / 17 |
| index | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| create | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 4 |
|||
| storePlatform | |
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 10 |
|||
| getPlatform | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| <?php | |
| namespace App\Http\Controllers\Setting; | |
| use App\Helpers\PlatformHelper; | |
| use App\Http\Controllers\Controller; | |
| use Illuminate\Http\Request as Request; | |
| use App\Models\Admin\Setting; | |
| use Session; | |
| // use App\Helpers\AttendanceHelper; | |
| class PlatformSettingController extends Controller | |
| { | |
| public function index() | |
| { | |
| } | |
| public function create(Request $request) | |
| { | |
| $title = '/Platforms'; | |
| $setting = Setting::pluck('value', 'name')->all(); | |
| // $val = $this->getAttendance(); | |
| // $valTeam = AttendanceHelper::getAttendanceTeam($request); | |
| // $valUser = AttendanceHelper::getAttendanceUser($request); | |
| $platform = PlatformHelper::getPlatformMarkValue($request); | |
| return view('administrationForms.Setting.PlatformSetting', compact('title', 'platform'))->with('setting', $setting); | |
| } | |
| public function storePlatform(Request $request) | |
| { | |
| if (auth()->user()->can('Edit Settings module')) { | |
| $value = $request->item_type; | |
| $platforms = explode(',', $value); | |
| $valueToStore = json_encode($platforms); | |
| $keyexist = Setting::where('name', 'platform')->where('category', 'general')->exists(); | |
| if ($keyexist) { | |
| Setting::where('name', '=', 'platform')->where('category', '=', 'general')->update(['value' => $valueToStore]); | |
| } else { | |
| Setting::create(['name' => "platform", 'value' => $valueToStore, 'category' => 'general', 'fieldtype' => 'text']); | |
| } | |
| return redirect()->back(); | |
| } else { | |
| return redirect()->back(); | |
| } | |
| } | |
| public function getPlatform() | |
| { | |
| $vall = Setting::where('name', 'platform')->where('category', 'general')->value('value'); | |
| return $vall; | |
| } | |
| } |