Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Apr 25, 2019
1 parent 3bdf92c commit e78cf02
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/Illuminate/Auth/Console/AuthMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,15 @@ public function handle()
*/
protected function createDirectories()
{
if (! is_dir($directory = $this->getViewsPath('layouts'))) {
if (! is_dir($directory = $this->getViewPath('layouts'))) {
mkdir($directory, 0755, true);
}

if (! is_dir($directory = $this->getViewsPath('auth/passwords'))) {
if (! is_dir($directory = $this->getViewPath('auth/passwords'))) {
mkdir($directory, 0755, true);
}
}

/**
* Get full path relative to the app's configured view path.
*
* @return string
*/
protected function getViewsPath($path)
{
return implode(DIRECTORY_SEPARATOR, [config('view.paths')[0] ?? resource_path('views'), $path]);
}

/**
* Export the authentication views.
*
Expand All @@ -101,7 +91,7 @@ protected function getViewsPath($path)
protected function exportViews()
{
foreach ($this->views as $key => $value) {
if (file_exists($view = $this->getViewsPath($value)) && ! $this->option('force')) {
if (file_exists($view = $this->getViewPath($value)) && ! $this->option('force')) {
if (! $this->confirm("The [{$value}] view already exists. Do you want to replace it?")) {
continue;
}
Expand All @@ -127,4 +117,16 @@ protected function compileControllerStub()
file_get_contents(__DIR__.'/stubs/make/controllers/HomeController.stub')
);
}

/**
* Get full view path relative to the app's configured view path.
*
* @return string
*/
protected function getViewPath($path)
{
return implode(DIRECTORY_SEPARATOR, [
config('view.paths')[0] ?? resource_path('views'), $path
]);
}
}

0 comments on commit e78cf02

Please sign in to comment.