Consuming Your API With JavaScript - Issue

Posted 1 month ago by partabsaifzakir

I am using Laravel 5.7 with Vuejs, i'm new at this, i just need to secure my data. When i see Laravel passport documentation, i did same but not working, when i use ('auth:api') i can't see my users table and in Postman app it okay that i cannot see my data, i just add this in my Kernal.php.

'web' => [
    // Other middleware...
    \Laravel\Passport\Http\Middleware\CreateFreshApiToken::class,
],

and then i use this constructor in API controller named 'UserController'

class UserController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('auth:api');
    }

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.