PHP Classes
elePHPant
Icontem

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

Recommend this page to a friend!
  Info   View files Example   View files View files (57)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-01-30 (1 month ago) RSS 2.0 feedStarStarStarStarStar 89%Total: 108 This week: 4All time: 8,569 This week: 199Up
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

  Performance   Level  
Name: Eray Akartuna <contact>
Classes: 2 packages by
Country: Turkey Turkey
Age: 22
All time rank: 395373 in Turkey Turkey
Week rank: 217 Up3 in Turkey Turkey Up

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 folder image Files  
File Role Description
Files folder imageapp (1 file, 9 directories)
Files folder imagebootstrap (1 file)
Files folder imageconfig (3 files)
Files folder imagedatabase (3 directories)
Files folder imagepublic (2 files)
Files folder imageresources (2 directories)
Files folder imagetests (2 files)
Accessible without login Plain text file .env.example Data Auxiliary data
Accessible without login Plain text file artisan Example Example script
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file server.php Appl. Application script

  Files folder image Files  /  app  
File Role Description
Files folder imageAuth (2 files)
Files folder imageConsole (1 file)
Files folder imageEvents (2 files)
Files folder imageExceptions (1 file)
Files folder imageHttp (1 file, 2 directories)
Files folder imageJobs (2 files)
Files folder imageListeners (1 file)
Files folder imageProviders (3 files)
Files folder imageSupport (1 file)
  Plain text file User.php Class Class source

  Files folder image Files  /  app  /  Auth  
File Role Description
  Plain text file Proxy.php Class Class source
  Plain text file User.php Class Class source

  Files folder image Files  /  app  /  Console  
File Role Description
  Plain text file Kernel.php Class Class source

  Files folder image Files  /  app  /  Events  
File Role Description
  Plain text file Event.php Class Class source
  Plain text file ExampleEvent.php Class Class source

  Files folder image Files  /  app  /  Exceptions  
File Role Description
  Plain text file Handler.php Class Class source

  Files folder image Files  /  app  /  Http  
File Role Description
Files folder imageControllers (4 files)
Files folder imageMiddleware (2 files)
  Accessible without login Plain text file routes.php Example Example script

  Files folder image Files  /  app  /  Http  /  Controllers  
File Role Description
  Plain text file AdminController.php Class Class source
  Plain text file AdminUserController.php Class Class source
  Plain text file Controller.php Class Class source
  Plain text file UserController.php Class Class source

  Files folder image Files  /  app  /  Http  /  Middleware  
File Role Description
  Plain text file Authenticate.php Class Class source
  Plain text file ExampleMiddleware.php Class Class source

  Files folder image Files  /  app  /  Jobs  
File Role Description
  Plain text file ExampleJob.php Class Class source
  Plain text file Job.php Class Class source

  Files folder image Files  /  app  /  Listeners  
File Role Description
  Plain text file ExampleListener.php Class Class source

  Files folder image Files  /  app  /  Providers  
File Role Description
  Plain text file AppServiceProvider.php Class Class source
  Plain text file AuthServiceProvider.php Class Class source
  Plain text file EventServiceProvider.php Class Class source

  Files folder image Files  /  app  /  Support  
File Role Description
  Accessible without login Plain text file helpers.php Example Example script

  Files folder image Files  /  bootstrap  
File Role Description
  Accessible without login Plain text file app.php Example Example script

  Files folder image Files  /  config  
File Role Description
  Accessible without login Plain text file app.php Aux. Auxiliary script
  Accessible without login Plain text file oauth2.php Conf. Configuration script
  Accessible without login Plain text file secrets.php Aux. Auxiliary script

  Files folder image Files  /  database  
File Role Description
Files folder imagefactories (1 file)
Files folder imagemigrations (15 files)
Files folder imageseeds (3 files)

  Files folder image Files  /  database  /  factories  
File Role Description
  Plain text file ModelFactory.php Class Class source

  Files folder image Files  /  database  /  migrations  
  Files folder image Files  /  database  /  seeds  
File Role Description
  Plain text file DatabaseSeeder.php Class Class source
  Plain text file OAuthSeeder.php Class Class source
  Plain text file UserSeeder.php Class Class source

  Files folder image Files  /  public  
File Role Description
  Accessible without login Plain text file .htaccess Data Auxiliary data
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  resources  
File Role Description
Files folder imagelang (1 directory)
Files folder imageviews (1 file)

  Files folder image Files  /  resources  /  lang  
File Role Description
Files folder imageen (1 file)

  Files folder image Files  /  resources  /  lang  /  en  
File Role Description
  Accessible without login Plain text file validation.php Conf. Configuration script

  Files folder image Files  /  resources  /  views  
File Role Description
  Accessible without login Plain text file client.blade.php Aux. Auxiliary script

  Files folder image Files  /  tests  
File Role Description
  Plain text file AdminTest.php Class Class source
  Accessible without login Plain text file TestCase.php Test Unit test script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:108
This week:4
All time:8,569
This week:199Up
 User Ratings  
 
 All time
Utility:100%StarStarStarStarStarStar
Consistency:100%StarStarStarStarStarStar
Documentation:100%StarStarStarStarStarStar
Examples:100%StarStarStarStarStarStar
Tests:91%StarStarStarStarStar
Videos:-
Overall:89%StarStarStarStarStar
Rank:1