Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
yanggyein
/
yanggyein
/
yanggyein
/
app
/
Common
/
Or
Select Your Path :
Upload File :
New :
File
Dir
//home/yanggyein/yanggyein/yanggyein/app/Common/AppHelper.php
<?php use App\Authority; use App\Menu; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Request as FacadesRequest; /* 단계별 URL 가져오기 '/' */ function getPathStep($step) { $path = FacadesRequest::path(); $returnPath = ""; $pathArray = explode('/', $path); $step = count($pathArray) < $step ? count($pathArray) : $step; for ($i = 0; $i < $step; $i++) { $returnPath = $returnPath . "/" . $pathArray[$i]; } return $returnPath; } /* 원하는 index path 가져오기 */ function getIndexPathStep($step) { $path = FacadesRequest::path(); $pathArray = explode('/', $path); return $pathArray[$step]; } /* 현재 URL 비교하기 */ function comparePath($targetPath, $step) { $path = FacadesRequest::path(); $returnPath = ""; $pathArray = explode('/', $path); $step = count($pathArray) < $step ? count($pathArray) : $step; for ($i = 0; $i < $step; $i++) { $returnPath = $returnPath . "/" . $pathArray[$i]; } $result = $targetPath == ($returnPath) ? true : false; return $result; } /* 대메뉴 가져오기 */ function getLargeMenus() { return Menu::all()->groupBy('large'); } /* 대메뉴에 따른 중메뉴 가져오기 */ function getMediumMenus($large) { return Menu::where('large', $large)->select('medium', 'large_url', 'medium_url')->get(); } /* 대메뉴에 따른 중메뉴 가져오기 */ function getLevelCompany($level) { return Authority::where('id', $level)->select('level', 'class', 'class_name')->first(); } /* 권한에 따른 Level 가져오기 */ function getLevel($authority_id) { return Authority::where('id', $authority_id)->value('level'); }