Skip to content

Commit

Permalink
Bug fix when creating nested/folder views
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminhansen committed Aug 6, 2024
1 parent c228f32 commit eb14ec0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
**/.DS_Store
._.DS_Store
**/._.DS_Store
vendor/
composer.lock
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"email": "bjhansen@benjaminhansen.net"
}
],
"require": {},
"require": {
"laravel/helpers": "^1.7"
},
"autoload": {
"psr-4": {
"BenjaminHansen\\LaravelMakeView\\": "src/"
Expand Down
3 changes: 3 additions & 0 deletions src/MakeView.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ public function handle()
$blade_template = strtolower(end($parts));
$blade_file = "{$blade_template}.blade.php";

// remove the last element from the array since it is our filename
array_pop($parts);

// loop over the entire array, except for the last element (which is the actual file)
// and create the necessary directories
foreach($parts as $folder) {
Expand Down

0 comments on commit eb14ec0

Please sign in to comment.