sb0321
sb0321

Reputation: 93

How can i customize laravel middleware 'auth:api'?

I want to customize my auth middleware that secure my endpoint.

for example, i want to accept requests that have specific bearer token. how can i do?

i'm using dingo api library.

Upvotes: 0

Views: 1587

Answers (1)

Mohammad Akbari
Mohammad Akbari

Reputation: 446

Go to kernel.php file in HTTP directory. You'll see something like this.

    'auth' => ExampleClass::class,

Find the ExampleClass and read its handle method. After you figure it out how it works, create your own middleware and implement your own logic in it. Read the laravel middlewares document for more information.

Upvotes: 2

Related Questions