{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/spark/issues/167","labels_url":"https://api.github.com/repos/laravel/spark/issues/167/labels{/name}","comments_url":"https://api.github.com/repos/laravel/spark/issues/167/comments","events_url":"https://api.github.com/repos/laravel/spark/issues/167/events","html_url":"https://github.com/laravel/spark/issues/167","id":124064785,"number":167,"title":"API issues","user":{"login":"michaelrtm","id":1237753,"avatar_url":"https://avatars.githubusercontent.com/u/1237753?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelrtm","html_url":"https://github.com/michaelrtm","followers_url":"https://api.github.com/users/michaelrtm/followers","following_url":"https://api.github.com/users/michaelrtm/following{/other_user}","gists_url":"https://api.github.com/users/michaelrtm/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelrtm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelrtm/subscriptions","organizations_url":"https://api.github.com/users/michaelrtm/orgs","repos_url":"https://api.github.com/users/michaelrtm/repos","events_url":"https://api.github.com/users/michaelrtm/events{/privacy}","received_events_url":"https://api.github.com/users/michaelrtm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-28T13:00:22Z","updated_at":"2015-12-29T16:19:11Z","closed_at":null,"body":"All API requests from Spark (eg /spark/api/users/me) are failing because they need web middleware.\r\nI'm running Spark:dev-master on Laravel 5.2.5"},"comment":{"url":"https://api.github.com/repos/laravel/spark/issues/comments/167824088","html_url":"https://github.com/laravel/spark/issues/167#issuecomment-167824088","issue_url":"https://api.github.com/repos/laravel/spark/issues/167","id":167824088,"user":{"login":"nickdenardis","id":37359,"avatar_url":"https://avatars.githubusercontent.com/u/37359?v=3","gravatar_id":"","url":"https://api.github.com/users/nickdenardis","html_url":"https://github.com/nickdenardis","followers_url":"https://api.github.com/users/nickdenardis/followers","following_url":"https://api.github.com/users/nickdenardis/following{/other_user}","gists_url":"https://api.github.com/users/nickdenardis/gists{/gist_id}","starred_url":"https://api.github.com/users/nickdenardis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickdenardis/subscriptions","organizations_url":"https://api.github.com/users/nickdenardis/orgs","repos_url":"https://api.github.com/users/nickdenardis/repos","events_url":"https://api.github.com/users/nickdenardis/events{/privacy}","received_events_url":"https://api.github.com/users/nickdenardis/received_events","type":"User","site_admin":false},"created_at":"2015-12-29T16:19:11Z","updated_at":"2015-12-29T16:19:11Z","body":"@danjy Yea, cutting out the unnecessary middlewares on api calls will make them faster and a few other things. \r\n\r\nThe problem comes in when the 'auth' middleware in this case relies on:  \r\n\r\n```\r\n'api' => [\r\n    \\App\\Http\\Middleware\\EncryptCookies::class,\r\n    \\Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse::class,\r\n    \\Illuminate\\Session\\Middleware\\StartSession::class,\r\n    \\App\\Http\\Middleware\\VerifyCsrfToken::class,\r\n    'throttle:60,1',\r\n],\r\n```\r\n\r\nWithout those `$this->auth->guest()` returns false or throws an error.\r\n\r\nSpecifically the [session storage](https://github.com/laravel/framework/blob/7f62d81acb2001faafb21a32544464ebfc92476c/src/Illuminate/Http/Request.php#L774):\r\n\r\n```\r\nRuntimeException in Request.php line 775:\r\nSession store not set on request.\r\n```"}}