Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Illuminate/Database/DatabaseServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected function registerEloquentFactory()

$this->app->singleton(EloquentFactory::class, function ($app) {
return EloquentFactory::construct(
$app->make(FakerGenerator::class), database_path('factories')
$app->make(FakerGenerator::class), $this->app->databasePath('factories')
);
});
}
Expand Down
25 changes: 15 additions & 10 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,51 +294,56 @@ protected function bindPathsInContainer()
/**
* Get the path to the application "app" directory.
*
* @param string $path Optionally, a path to append to the app path
* @return string
*/
public function path()
public function path($path = '')
{
return $this->basePath.DIRECTORY_SEPARATOR.'app';
return $this->basePath.DIRECTORY_SEPARATOR.'app'.($path ? DIRECTORY_SEPARATOR.$path : $path);
}

/**
* Get the base path of the Laravel installation.
*
* @param string $path Optionally, a path to append to the base path
* @return string
*/
public function basePath()
public function basePath($path = '')
{
return $this->basePath;
return $this->basePath.($path ? DIRECTORY_SEPARATOR.$path : $path);
}

/**
* Get the path to the bootstrap directory.
*
* @param string $path Optionally, a path to append to the bootstrap path
* @return string
*/
public function bootstrapPath()
public function bootstrapPath($path = '')
{
return $this->basePath.DIRECTORY_SEPARATOR.'bootstrap';
return $this->basePath.DIRECTORY_SEPARATOR.'bootstrap'.($path ? DIRECTORY_SEPARATOR.$path : $path);
}

/**
* Get the path to the application configuration files.
*
* @param string $path Optionally, a path to append to the config path
* @return string
*/
public function configPath()
public function configPath($path = '')
{
return $this->basePath.DIRECTORY_SEPARATOR.'config';
return $this->basePath.DIRECTORY_SEPARATOR.'config'.($path ? DIRECTORY_SEPARATOR.$path : $path);
}

/**
* Get the path to the database directory.
*
* @param string $path Optionally, a path to append to the database path
* @return string
*/
public function databasePath()
public function databasePath($path = '')
{
return $this->databasePath ?: $this->basePath.DIRECTORY_SEPARATOR.'database';
return ($this->databasePath ?: $this->basePath.DIRECTORY_SEPARATOR.'database').($path ? DIRECTORY_SEPARATOR.$path : $path);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ function csrf_token()
*/
function database_path($path = '')
{
return app()->databasePath().($path ? DIRECTORY_SEPARATOR.$path : $path);
return app()->databasePath($path);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function boot()

if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__.'/resources/views' => resource_path('views/vendor/notifications'),
__DIR__.'/resources/views' => $this->app->resourcePath('views/vendor/notifications'),
], 'laravel-notifications');
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Pagination/PaginationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function boot()

if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__.'/resources/views' => resource_path('views/vendor/pagination'),
__DIR__.'/resources/views' => $this->app->resourcePath('views/vendor/pagination'),
], 'laravel-pagination');
}
}
Expand Down