From 884a0917fa7ba777ae50da014bb32653831469bc Mon Sep 17 00:00:00 2001 From: A1Gard Date: Fri, 22 Nov 2024 13:31:02 +0330 Subject: [PATCH] fixed bug for windows area design --- app/Http/Controllers/Admin/AreaController.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Admin/AreaController.php b/app/Http/Controllers/Admin/AreaController.php index b1868a4..0367d89 100644 --- a/app/Http/Controllers/Admin/AreaController.php +++ b/app/Http/Controllers/Admin/AreaController.php @@ -29,11 +29,12 @@ class AreaController extends Controller if (File::exists(resource_path() . '/views/segments/' . $seg)) { $dirs = File::directories(resource_path() . '/views/segments/' . $seg); foreach ($dirs as $dir) { - $temp = explode('/', $dir); + $tmp = str_replace(DIRECTORY_SEPARATOR,'/',$dir); + $temp = explode('/', $tmp); $valids[] = [ 'segment' => $temp[count($temp) - 2], 'part' => $temp[count($temp) - 1], - 'data' => json_decode(file_get_contents($dir . '/' . $temp[count($temp) - 1] . '.json'), true) + 'data' => json_decode(file_get_contents($dir . DIRECTORY_SEPARATOR. $temp[count($temp) - 1] . '.json'), true) ]; } } @@ -67,11 +68,12 @@ class AreaController extends Controller if (File::exists(resource_path() . '/views/segments/' . $seg)) { $dirs = File::directories(resource_path() . '/views/segments/' . $seg); foreach ($dirs as $dir) { - $temp = explode('/', $dir); + $tmp = str_replace(DIRECTORY_SEPARATOR,'/',$dir); + $temp = explode('/', $tmp); $valids[] = [ 'segment' => $temp[count($temp) - 2], 'part' => $temp[count($temp) - 1], - 'data' => json_decode(file_get_contents($dir . '/' . $temp[count($temp) - 1] . '.json'), true) + 'data' => json_decode(file_get_contents($dir . DIRECTORY_SEPARATOR. $temp[count($temp) - 1] . '.json'), true) ]; } }