Laravel Custom Response Messages from Passport Oauth2 Server

Overview

Laravel Custom Response Messages from Passport Oauth2 Server

This sample project is meant to help beginners struggling with setting up Oauth2 server in laravel. It's using Laravel's official Oauth2 Passport package for this purpose. Another reason why this project is important is the customization of messages from passport and laravel in order to have a standard format for all the reponses sent back to the client. The test login credentials for the applications are:

Username: [email protected]

Password: a

Steps to install and run

All the commands down below should be run in project's root directory

  1. Clone the repository by running the following command
git clone https://github.com/ismail17719/Laravel-Passport-With-Custom-Response-Messages.git
  1. Open the terminal and go to the project root directory
  2. Run the composer command to install all dependencies
composer install
  1. Open .env.example and save it as .env file in the same root directory
  2. Open .env file and change the following database details
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=YOURDATABASE
DB_USERNAME=USERNAME
DB_PASSWORD=PASSWORD
  1. Run the following command to generate a unique for the application
php artisan key:generate
  1. Next we need to build the database. In order to do that run the following command in terminal. Let the process complete
php artisan migrate --seed
  1. To get the client id and secret run this command. Please, use Client ID: 2. that's the password grant client that we need.
php artisan passport:install
  1. Passport needs encryption keys to generate access tokens. To generate encryption keys for Passprot run the following commmand
php artisan passport:keys
  1. Congrats!! You are done. Everything else is done for. Now checkout the routes/api.php route file to see and test different routes. You can make http requests using something like Postman or Insomnia.
    💥 💥 💥
You might also like...
Simple PSR-7 compatible response sender

Simple PSR-7 compatible response sender

Simple package to handle response properly in your API.

Simple package to handle response properly in your API. This package uses Fractal and is based on Build APIs You Won't Hate book.

Laravel Messages (Contact us) with attachment.
Laravel Messages (Contact us) with attachment.

Laravel Messages (Contact us) with attachment. Documentation You can find the detailed documentation here in Laravel Messages Documentation. Contribut

A package to flash multiple messages using Laravels default session message flashing system
A package to flash multiple messages using Laravels default session message flashing system

Flash multiple advanced messages with both text, messages and links An opinionated solution for flashing multiple advanced messages from the backend a

An online communication application that provides a real-time or live transmission of text messages from sender to receiver.

Realtime-chat-application An online communication application that provides a real-time or live transmission of text messages from sender to receiver.

One-to-one plugin for editing world chat messages.

WorldChat One-to-one plugin for editing world chat messages. Supports English and Turkish language To set a new world chat format /worldchat new "worl

Laravel Boilerplate provides a very flexible and extensible way of building your custom Laravel applications.
Laravel Boilerplate provides a very flexible and extensible way of building your custom Laravel applications.

Laravel Boilerplate Project Laravel Boilerplate provides a very flexible and extensible way of building your custom Laravel applications. Table of Con

Add Social Reactions to Laravel Eloquent Models. It lets people express how they feel about the content. Fully customizable Weighted Reaction System & Reaction Type System with Like, Dislike and any other custom emotion types. Do you react?
Make your own custom cast type for Laravel model attributes

Laravel Custom Casts Make your own cast type for Laravel model attributes Laravel custom casts works similarly to Eloquent attribute casting, but with

Owner
M. Ismail
Hi, I am a full stack web developer. I can work in PHP Laravel/Lumen, Microservices, JavaScript, VueJS,jQuery, CSS, Bootstrap, and TailwindCSS.
M. Ismail
PHP library for sending messages using a ntfy server.

ntfy-php-library PHP library for sending messages using a ntfy server. Supports ntfy server version 1.27.2. Install composer require verifiedjoseph/nt

Joseph 6 Dec 14, 2022
Easily capture every incoming request and the corresponding outgoing response in your Laravel app.

Easily capture every incoming request and the corresponding outgoing response in your Laravel app. This package is designed to work only with the Lara

Mark Townsend 22 Nov 15, 2022
This Package helps you in laravel application to log all desired activity for each request from request entry point to generate response at a single snapshot.

Laravel Scenario Logger This Package helps you in laravel application to log all desired activity for each request from request entry point to generat

Mehrdad Mahdian 6 Sep 27, 2021
Convert remote api response data into laravel model

laravel remote model Create remote driver to convert remote api request into laravel model. 中文文档 日本語文書 overview Install the version between laravel5.5

张子彬 15 Aug 11, 2022
A Laravel response helper methods.

A Laravel response helper methods. The package respond provides a fluent syntax to form array or json responses.

Najm Njeim 5 Nov 2, 2021
Simple and ready to use API response wrapper for Laravel.

Laravel API Response Simple Laravel API response wrapper. Installation Install the package through composer: $ composer require obiefy/api-response Re

Obay Hamed 155 Dec 14, 2022
Provides a powerful error response system for Laravel

Laravel Exceptions Laravel Exceptions was created by, and is maintained by Graham Campbell, and provides a powerful error response system for both dev

Graham Campbell 571 Jan 31, 2022
Laravel Response Formatter

I created this package to make it easier to format the response from a controller. I have used this package in my projects and I hope you enjoy it!

aris wahyudiyanto 12 Dec 5, 2022
Learning Websocket by creating Custom Websocket-server package provided by Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling.

Chisty Md.Muzammel Hossain 3 Oct 25, 2022
A Magento Incident Response Plan Template

A Magento centric Incident Response Plan Template Introduction This will provide you with our defined process and procedures to use when responding to

Talesh Seeparsan 75 Dec 30, 2022