---
title: "Discussion on \"How to Set Up Laravel Passport Authentication\" | Hashnode"
description: "Discussion on \"How to Set Up Laravel Passport Authentication\". In this tutorial, I am going to show you how to set up Laravel Passport.\nI believe that this package is easy enough to learn and use already, but I want to share the exact way I go about starting a project that needs to have an API.\nTerminal\nFirst of..."
url: "https://hashnode.com/posts/how-to-set-up-laravel-passport-authentication/5cf3a36b63b3b55b6175f7cd"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Set Up Laravel Passport Authentication](https://vincenzoraco.dev/how-to-set-up-laravel-passport-authentication?utm_source=hashnode&utm_medium=feed)

In this tutorial, I am going to show you how to set up Laravel Passport. I believe that this package is easy enough to learn and use already, but I want to share the exact way I go about starting a project that needs to have an API. Terminal First of...

Jun 2, 2019 · vincenzoraco.dev  
Read the article

-   [#php](https://hashnode.com/tag/php)
-   [#laravel](https://hashnode.com/tag/laravel)
-   [#passport](https://hashnode.com/tag/passport)

## Written by

[Vincenzo Raco](https://hashnode.com/@vincenzoracoDEV)

@vincenzoracoDEV · Perth, AU

  
[View profile](https://hashnode.com/@vincenzoracoDEV)

Senior Web Developer

## Responses 1

Markdown supported · ⌘↵ to post

[japet saberon](https://hashnode.com/@japet)

[Sep 26, 2019](https://hashnode.com/posts/how-to-set-up-laravel-passport-authentication/5cf3a36b63b3b55b6175f7cd/comment/5d8c12fb96ab87572b2b4b81)

Hello sir, I'm follow your blog but I got lost in `not_authorized` and `auth.guest`.

In the `not_authorized`, should I put the `not_authorized` in `config->auth.php` or in `resource->lang->en->auth.php`.

In the `auth.guest`, should I put it in `$middleware` or `$routeMiddleware`?

[Vincenzo Raco](https://hashnode.com/@vincenzoracoDEV)

[Sep 26, 2019](https://hashnode.com/posts/how-to-set-up-laravel-passport-authentication/5cf3a36b63b3b55b6175f7cd/comment/5d8c12fb96ab87572b2b4b81#reply-5d8c16ebea59e50772c49e3f)

Hi [japet saberon](https://hashnode.com/@japet), I am happy that my post is helping you. Let me explain a bit better.

The `not_authorized` in this case is a localization key, and it should be entered in the `resource\lang\en\auth.php`, you can read more about localization directly from the laravel website: laravel.com/docs/localization - but let me know if you still struggle.

About the `auth.guest` middleware, as mentioned on my post, you should put it in $middleware property of your `app/Http/Kernel.php` class.

Let me know if you need more help :)
