title: generating API and laravel passport
body: <p>I'm new to Laravel and kindly answer my question, please.<br></p>
  
  <p>I'm developing a system with Laravel 5.8 in which two user levels are included.</p>
  
  <ol>
  <li>user</li>
  <li>admin</li>
  </ol>
  
  <p><li>Authenticated users can view and store the posts into database. (action: <code>index</code>, <code>show</code> and <code>store</code>)</li>
  <li>And authenticated admins can view the posts that the users have posted and approve to publish. (action: <code>index</code>, <code>show</code>, <code>store</code> and <code>destroy</code>)</li></p>
  
  <p>My database table:books is like below:
  <li>id</li>
  <li>name</li>
  <li>numbers_of_pages</li>
  <li>type</li>
  <li>author</li></p>
  
  <p>and users table:
  <li>id</li>
  <li>name</li>
  <li>email</li>
  <li>password</li></p>
  
  <p>and admins table:
  <li>id</li>
  <li>name</li>
  <li>email</li>
  <li>password</li></p>
  
  <p><strong>First Question:</strong></p>
  
  <p>In my <code>api.php</code></p>
  
  <pre><code>Route::apiResource('books', 'BookController');
  </code></pre>
  
  <p>Follow is my desired routes structrues.</p>
  
  <pre><code># index()
  // http://127.0.0.1:8000/api/v1/books/drama -&gt; get all books where type is drama
  // http://127.0.0.1:8000/api/v1/books/novel -&gt; get all books where type is novel
  // http://127.0.0.1:8000/api/v1/books/magazine -&gt; get all books where type is magazine
  </code></pre>
  
  <p>How can I achieve that with my BookController created by the command:</p>
  
  <pre><code>php artisan make:controller BookController --api
  </code></pre>
  
  <p>and how to prefix <em>v1</em> in the route? I don't want to prefix that version number in RouteServiceProvider.php.</p>
  
  <p><strong>Another Question:</strong><br>
  How to oauth that multiple users? Both admins and users are consumers of the api.</p>