Lumen Starter Pack: Implement a OAuth 2 based REST API server

Recommend this page to a friend!
  Info   Example   View files (57)   Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
89%Total: 329 This week: 1All time: 7,055 This week: 255
Version License PHP version Categories
lumen-starter-pack 1.0.1The PHP License5PHP 5, User Management, Libraries, We...
Collaborate with this project Author

lumen-starter-pack - github.com

Description

This package can implement a OAuth 2 based REST API server.

It implements a module on top of Lumen Laravel micro-framework to provide a REST API based on OAuth2 authorization.

The package also provides a users module with permission control that can create, update, delete and list users.

Recommendations

Suitable out of the box REST API
REST API to replace service without a backend

Picture of Eray Akartuna
  Performance   Level  
Name: Eray Akartuna <contact>
Classes: 2 packages by
Country: Turkey Turkey
Age: 25
All time rank: 346955 in Turkey Turkey
Week rank: 243 4 in Turkey Turkey

Details

Lumen Starter Pack

This package can implement a OAuth 2 based REST API server.

It implements a module on top of Lumen Laravel micro-framework to provide a REST API based on OAuth2 authorization.

The package also provides a users module with permission control that can create, update, delete and list users.

Installation

How To

  • Insert project into empty folder / git clone https://github.com/erayakartuna/lumen-starter-pack.git
  • Create an empty database table
  • Copy the .env.example to .env and insert the Database config
  • Run the following commands
    composer install
    php artisan migrate
    php artisan db:seed
    
    Thats it!

Usage

Routes

-------------------------------------------------------------------------------------
POST      => /login   Required Params:email,password
POST      => /refresh-token
-------------------------------------------------------------------------------------
Required Params : access_token

GET       => /admin/users             AdminUserController@index
POST      => /admin/users             AdminUserController@store
GET       => /admin/users/{user_id}   AdminUserController@show
PATCH     => /admin/users/{user_id}   AdminUserController@update
DELETE    => /admin/users/{user_id}   AdminUserController@destroy

-------------------------------------------------------------------------------------
GET       => /users   Required params: access_token   |  UserController@index
-------------------------------------------------------------------------------------

*Look inside to Unit tests to understand more*

Users Table Schema

Schema::create('users', function(Blueprint $table)
		{
			$table->increments('id');
			$table->string('name');
			$table->string('email')->unique();
			$table->string('password', 60);
			$table->boolean('is_admin',0);
			$table->rememberToken();
			$table->timestamps();
		});

User Login Informations

user@user.com
user1234

Resources

LUMEN

LUMEN API OAUTH

  Files  
File Role Description
app (1 file, 9 directories)
bootstrap (1 file)
config (3 files)
database (3 directories)
public (2 files)
resources (2 directories)
tests (2 files)
.env.example Data Auxiliary data
artisan Example Example script
composer.json Data Auxiliary data
composer.lock Data Auxiliary data
phpunit.xml Data Auxiliary data
README.md Doc. Documentation
server.php Appl. Application script

  Files  /  app  
File Role Description
Auth (2 files)
Console (1 file)
Events (2 files)
Exceptions (1 file)
Http (1 file, 2 directories)
Jobs (2 files)
Listeners (1 file)
Providers (3 files)
Support (1 file)
   User.php Class Class source

  Files  /  app  /  Auth  
File Role Description
   Proxy.php Class Class source
   User.php Class Class source

  Files  /  app  /  Console  
File Role Description
   Kernel.php Class Class source

  Files  /  app  /  Events  
File Role Description
   Event.php Class Class source
   ExampleEvent.php Class Class source

  Files  /  app  /  Exceptions  
File Role Description
   Handler.php Class Class source

  Files  /  app  /  Http  
File Role Description
Controllers (4 files)
Middleware (2 files)
   routes.php Example Example script

  Files  /  app  /  Http  /  Controllers  
File Role Description
   AdminController.php Class Class source
   AdminUserController.php Class Class source
   Controller.php Class Class source
   UserController.php Class Class source

  Files  /  app  /  Http  /  Middleware  
File Role Description
   Authenticate.php Class Class source
   ExampleMiddleware.php Class Class source

  Files  /  app  /  Jobs  
File Role Description
   ExampleJob.php Class Class source
   Job.php Class Class source

  Files  /  app  /  Listeners  
File Role Description
   ExampleListener.php Class Class source

  Files  /  app  /  Providers  
File Role Description
   AppServiceProvider.php Class Class source
   AuthServiceProvider.php Class Class source
   EventServiceProvider.php Class Class source

  Files  /  app  /  Support  
File Role Description
   helpers.php Example Example script

  Files  /  bootstrap  
File Role Description
   app.php Example Example script

  Files  /  config  
File Role Description
   app.php Aux. Auxiliary script
   oauth2.php Conf. Configuration script
   secrets.php Aux. Auxiliary script

  Files  /  database  
File Role Description
factories (1 file)
migrations (15 files)
seeds (3 files)

  Files  /  database  /  factories  
File Role Description
   ModelFactory.php Class Class source

  Files  /  database  /  migrations  
  Files  /  database  /  seeds  
File Role Description
   DatabaseSeeder.php Class Class source
   OAuthSeeder.php Class Class source
   UserSeeder.php Class Class source

  Files  /  public  
File Role Description
   .htaccess Data Auxiliary data
   index.php Example Example script

  Files  /  resources  
File Role Description
lang (1 directory)
views (1 file)

  Files  /  resources  /  lang  
File Role Description
en (1 file)

  Files  /  resources  /  lang  /  en  
File Role Description
   validation.php Conf. Configuration script

  Files  /  resources  /  views  
File Role Description
   client.blade.php Aux. Auxiliary script

  Files  /  tests  
File Role Description
   AdminTest.php Class Class source
   TestCase.php Test Unit test script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:329
This week:1
All time:7,055
This week:255
 User Ratings  
 
 All time
Utility:100%
Consistency:100%
Documentation:100%
Examples:100%
Tests:91%
Videos:-
Overall:89%
Rank:1
  

For more information send a message to info at phpclasses dot org.