Skip to content

Commit

Permalink
add view path method
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Feb 15, 2021
1 parent d9e28dc commit af3a651
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,21 @@ public function resourcePath($path = '')
return $this->basePath.DIRECTORY_SEPARATOR.'resources'.($path ? DIRECTORY_SEPARATOR.$path : $path);
}

/**
* Get the path to the views directory.
*
* This method returns the first configured path in the array of view paths.
*
* @param string $path
* @return string
*/
public function viewPath($path = '')
{
$basePath = $this['config']->get('view.paths')[0];

return rtrim($basePath, DIRECTORY_SEPARATOR).($path ? DIRECTORY_SEPARATOR.$path : $path);
}

/**
* Get the path to the environment file directory.
*
Expand Down

0 comments on commit af3a651

Please sign in to comment.