Skip to content

Instantly share code, notes, and snippets.

@blogcacanid

blogcacanid/web.php

Created Jun 20, 2020
Embed
What would you like to do?
web.php Rest API Dengan JSON Web Token Lumen 7
<?php
/*
|--------------------------------------------------------------------------
| 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('/', function () use ($router) {
return $router->app->version();
});
$router->group(['middleware' => 'auth','prefix' => 'api'], function ($router)
{
$router->get('profile', 'AuthController@profile');
});
$router->group(['prefix' => 'api'], function () use ($router)
{
$router->post('register', 'AuthController@register');
$router->post('login', 'AuthController@login');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.