Skip to content

Commit

Permalink
fixed bug for windows area design
Browse files Browse the repository at this point in the history
  • Loading branch information
A1Gard committed Nov 22, 2024
1 parent 71ceef3 commit 884a091
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/Http/Controllers/Admin/AreaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ public function design(Area $area)
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)
];
}
}
Expand Down Expand Up @@ -67,11 +68,12 @@ public function designModel(Area $area, $model, $id)
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)
];
}
}
Expand Down

0 comments on commit 884a091

Please sign in to comment.