Skip to content

Commit

Permalink
Added configurable paths
Browse files Browse the repository at this point in the history
  • Loading branch information
James Wigger committed Oct 31, 2017
1 parent b92bb09 commit d970ab5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## v2.1.0 - 31/10/2017
* Added constant to define public path
* Added constant to define layout path

## v2.0.0 - 08/08/2017

* Renamed `mix()` to `base_asset()`
Expand Down
12 changes: 10 additions & 2 deletions src/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ public function getBasePath(): string
*/
public function getPublicPath(): string
{
return $this->getBasePath() . DIRECTORY_SEPARATOR . 'public';
if (!defined('BASE_PUBLIC_DIR')) {
define('BASE_PUBLIC_DIR', 'public');
}

return $this->getBasePath() . DIRECTORY_SEPARATOR . BASE_PUBLIC_DIR;
}

/**
Expand All @@ -68,6 +72,10 @@ public function getPublicPath(): string
*/
public function getLayoutPath(): string
{
return $this->getPublicPath() . DIRECTORY_SEPARATOR . 'layouts';
if (!defined('BASE_LAYOUT_DIR')) {
define('BASE_LAYOUT_DIR', 'layouts');
}

return $this->getPublicPath() . DIRECTORY_SEPARATOR . BASE_LAYOUT_DIR;
}
}

0 comments on commit d970ab5

Please sign in to comment.