Skip to content

Instantly share code, notes, and snippets.

@ridhof
Last active July 27, 2019 13:07
Show Gist options
  • Save ridhof/07ebb9dadd5d9e84d2ce903c6efbeb75 to your computer and use it in GitHub Desktop.
Save ridhof/07ebb9dadd5d9e84d2ce903c6efbeb75 to your computer and use it in GitHub Desktop.
<?php
use \Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/
$router->get('/login', function (Request $request) {
$token = app('auth')->attempt($request->only('email', 'password'));
return response()->json(compact('token'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment