Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 30 |
| PlatformHelper | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
110 | |
0.00% |
0 / 30 |
| getPlatformMarkValue | |
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 7 |
|||
| getPlatformTeam | |
0.00% |
0 / 1 |
30 | |
0.00% |
0 / 16 |
|||
| getPlatformUser | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 7 |
|||
| <?php | |
| namespace App\Helpers; | |
| use App\Models\Admin\Setting; | |
| use App\Models\Admin\Team; | |
| use App\Models\Auth\User; | |
| use App\Models\Admin\TeamSetting; | |
| use App\Models\Admin\userSetting; | |
| use App\Models\Admin\TeamUserDetail; | |
| use Illuminate\Http\Request; | |
| use Illuminate\Support\Facades\Auth; | |
| use Gate; | |
| class PlatformHelper | |
| { | |
| // Global function for Platform mark value for oraganisation level | |
| public static function getPlatformMarkValue() | |
| { | |
| if (Gate::check('Super Admin')) { | |
| $vall = null; | |
| } else { | |
| $platformMarkvalue = Setting::where('name', '=', 'platform')->where('category', '=', 'general')->first(); | |
| if ($platformMarkvalue) { | |
| $vall = $platformMarkvalue->value; | |
| } else { | |
| $vall = null; | |
| } | |
| } | |
| return $vall; | |
| } | |
| // Global function for Platform mark value for team level | |
| public static function getPlatformTeam($id, $bit = 1) | |
| { | |
| if (Gate::check('Super Admin')) { | |
| $valTeam = null; | |
| return $valTeam; | |
| } | |
| $parameter = $id; | |
| if ($bit == 1) { | |
| $parameter = $id->user()->userdetail->primary_team_id; | |
| } | |
| if (Gate::check('Super Admin')) { | |
| $valTeam = null; | |
| } else { | |
| $platformMarkTeam = TeamSetting::where('name', 'platform') | |
| ->where('category', 'Team') | |
| ->where('team_id', $parameter) | |
| ->first(); | |
| // dd($platformMarkTeam->value); | |
| if ($platformMarkTeam) { | |
| $valTeam = $platformMarkTeam->value; | |
| } else { | |
| $valTeam = null; | |
| } | |
| } | |
| return $valTeam; | |
| } | |
| // Global function for Platforms mark value for user level | |
| public static function getPlatformUser($id) | |
| { | |
| // if (Gate::check('Super Admin')) { | |
| // $valUser = null; | |
| // return $valUser; | |
| // } | |
| $user_id = $id; | |
| // if ($bit == 1) { | |
| // $user_id = $id->user()->id; | |
| // } | |
| // if (Gate::check('Super Admin')) { | |
| // $platformUser = null; | |
| // } else { | |
| $platformMarkUser = userSetting::where('user_id', $user_id) | |
| ->value('Platform_check'); | |
| if ($platformMarkUser) { | |
| $platformUser = $platformMarkUser; | |
| } else { | |
| $platformUser = null; | |
| } | |
| // } | |
| return $platformUser; | |
| } | |
| } | |
| ?> |