Looking for a start-to-finish how-to on Laravel 5.2 OAuth2 implementation
<p>Quick background: I'm fairly experienced with PHP, but needed to build my first RESTful API. I figured I'd try Laravel (5.2) and am starting to feel pretty comfortable with it.</p>

<p>I started adding auth to my project over the weekend and I am really struggling to get it working. I got the basic Laravel Auth middleware working quickly, but I think I need to be using OAuth2 for production (I will be building a mobile app that will connect up to this server). I'm using the Luca Degasperi OAuth2 package, which seems to be pretty popular.</p>

<p>I reviewed the actual documentation: <a href="https://github.com/lucadegasperi/oauth2-server-laravel/tree/master/docs#readme" rel="nofollow">https://github.com/lucadegasperi/oauth2-server-laravel/tree/master/docs#readme</a>)</p>

<p>I also went through this tutorial: <a href="https://medium.com/@mshanak/laravel-5-token-based-authentication-ae258c12cfea#.5lszb67xb" rel="nofollow">https://medium.com/@mshanak/laravel-5-token-based-authentication-ae258c12cfea#.5lszb67xb</a></p>

<p>And, most recently, I found this thread about the need to seed the OAuth tables before anything will work: <a href="https://github.com/lucadegasperi/oauth2-server-laravel/issues/56" rel="nofollow">https://github.com/lucadegasperi/oauth2-server-laravel/issues/56</a></p>

<p>That's all great, but there are some minor differences in the most recent distribution of Laravel. For example, /app/Http/Kernel.php is slightly different from what's shown in some of the examples I found because it now uses middleware groups. I thought I handled those differences correctly (I added the OAuthExceptionHandlerMiddleware class to the 'web' section of $middlewareGroups instead of $middleware). I got my seeder working (the current oauth_scopes table only allows you to supply a description, so I had to slim down what was provided in the third link above).</p>

<p>If I put a test route in my 'web' group in routes.php, I would have thought this would require OAuth because I added OAuth to the 'web' middleware group in Kernel.php. That's not the case. My route works with no authentication if I do that.</p>

<p>I then explicitly added the OAuth middleware to my test route as follows:</p>

<pre><code>Route::get('tests/events', ['middleware' =&gt; 'oauth', function() {
    $events = App\Event::get();
    return response()-&gt;json($events);
}]);
</code></pre>

<p>That causes a 500 error ("ErrorException in OAuth2ServerServiceProvider.php line 126: explode() expects parameter 2 to be string, object given").</p>

<p>I'm to feel pretty lost. Each of these packages seems to be shifting so quickly that there's no <em>complete</em> documentation on how to get this up and running.</p>

<p>What else do I need to do to get this functioning?</p>