Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

[Proposal] Service Provider Routes Function (cosmetics) #310

Closed
ghost opened this issue Nov 19, 2016 · 0 comments
Closed

[Proposal] Service Provider Routes Function (cosmetics) #310

ghost opened this issue Nov 19, 2016 · 0 comments

Comments

@ghost
Copy link

ghost commented Nov 19, 2016

Simply cosmetics for package developers.

Add function to \Illuminate\Support\ServiceProvider.

/**
 * Register routes.
 *
 * @param  string  $path
 * @return void
 */
protected function loadRoutesFrom($path)
{
    if (!$this->app->routesAreCached()) {
        require $path;
    }
}

Allows the developers boot() function....

/**
 * Perform post-registration booting of services.
 *
 * @return void
 */
public function boot()
{
    $this->loadRoutesFrom(__DIR__.'/../routes.php');

    $this->loadMigrationsFrom(__DIR__.'/../migrations');

    $this->loadViewsFrom(__DIR__.'/../views', 'package');

    $this->publishes([
        __DIR__.'/../config.php' => config_path('package.php')
    ]);
}
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants