Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nerdo/964c0bf9662db99a4691bf9c6ab8729c to your computer and use it in GitHub Desktop.
Save nerdo/964c0bf9662db99a4691bf9c6ab8729c to your computer and use it in GitHub Desktop.

Revisions

  1. nerdo created this gist Jul 26, 2016.
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    <?php
    // Foundation\Application.php
    /**
    * Base application created for the purpose of setting up a custom router in L5, per
    * https://laracasts.com/discuss/channels/general-discussion/can-i-find-the-way-to-extend-router-or-replace-customer-router-class-on-laravel5
    */
    namespace App\Foundation;

    use App\Providers\RoutingServiceProvider; // your custom RoutingServiceProvider
    use Illuminate\Events\EventServiceProvider;
    use Illuminate\Foundation\Application as LaravelApplication;

    class Application extends LaravelApplication {
    /**
    * Register all of the base service providers.
    * @return void
    */
    protected function registerBaseServiceProviders() {
    $this->register(new EventServiceProvider($this));
    $this->register(new RoutingServiceProvider($this));
    }
    }

    // bootstrap/app.php
    // $app = new Illuminate\Foundation\Application(
    $app = new App\Foundation\Application(
    realpath(__DIR__.'/../')
    );

    // ...