title: How can I create routes similar to Auth::routes()
body: <p>I created a laravel package with routes. I want to do something similar to Laravel's authentication scaffolding <code>Auth::routes()</code>, where they are injected into whatever file you want to include them (i.e. <code>api.php</code> or <code>web.php</code>).</p>
  
  <p>I am currently using</p>
  
  <pre><code>public function boot()
  {
      ...
      $this-&gt;loadRoutesFrom(__DIR__.'/routes/api.php');
      ...
  }
  </code></pre>
  
  <p>But this makes the routes available from anywhere, which I do not want.
  I understand I should use a <code>Service Container</code>, but this is my first package and first time creating my own Service Provider, so I am not too sure how to do so, and I couldn't find documentation on how to use these for routes.</p>
  
  <p>Instead, I want to be able to do something along the lines of:</p>
  
  <pre><code>//routes/api.php
  Route::group(['prefix'=&gt;'v1', 'middleware:auth-api'], function(){
      Logging::routes(); //&lt;-----
      ...
  });
  </code></pre>