Lumen

sudo composer create-project --prefer-dist laravel/lumen blog

Installation

Then edit your .env file with DB configuration and if no key present, run "php artisan key:generate". At this point you should see a welcome screen!

Resources

Example Usage

<?php
$app->get('/api/users', function () {
    $users = app('db')->select("SELECT * FROM users");

    return response()->json([
        'status' => true,
        'users' => $users
    ]);
});

$app->get('/api/user/{id}', [ 'as' => 'user.view', function ($id) {
    $user = app('db')->select("SELECT * FROM user WHERE id = ?", [ $id ]);

    return response()->json([
        'status' => true,
        'user' => $user
    ]);
}]);

Lumen

By Charlie Page

Lumen

  • 749