Thursday , 22 October 2020
Stackode
Home > Laravel > Installation and Running Lumen – Laravel

Installation and Running Lumen – Laravel

To the point Installation and Running Lumen – Laravel

Lumen is micro-framework by Laravel

Installation

1. Server Requirements

  • PHP >= 5.5.9
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension

2. Installing Lumen

Installing Lumen with Composer to manage its dependencies. Make sure you have Composer installed on your machine.

Via Lumen installer

Download Lumen installer via composer

$ composer global require "laravel/lumen-installer"

And then method of installation is much faster than installing via Composer:

$ lumen new name_your_project

Via Composer Create Project

Using the Composer create-project command in your terminal

$ composer create-project --prefer-dist laravel/lumen name_your_project

3. Configuration

All of the configuration options for the Lumen framework are stored in the .env file. Once Lumen is installed, you should also configure your local environment.

Application Key

The next thing you should do after installing Lumen is set your application key to a random string. Typically, this string should be 32 characters long. The key can be set in the .env environment file. If you have not renamed the .env.example file to .env, you should do that now. If the application key is not set, your user encrypted data will not be secure!

4. Running after installing Lumen

Configuration

Copy paste your .env.example, like this.

env-lumen-laravel
env-lumen-laravel

running first your lumen on browser.

http://localhost/lumen/public

or

- If you using windows, Open command Prompt or terminal if unix.
- Navigate to your project directory.
- execute this command: "php -S localhost:80 -t ./public".
- Open your borwser and visit http://localhost:port.

Thnk : Iginla Omotayo

if you got error, edited file index.php in folder public. Change

$app->run();

to

$app->run($app->make('request'));

if works, you will get output on you browser like this.

Lumen (5.2.7) (Laravel Components 5.2.*)

Add key application lumen on file .env

Edit file routes.php in folder Controllers and change, like this ( it`s up to u )

$app->get('/', function () use ($app) {
    return $app->version();
});
$app->get('/key', function () use ($app) {
    return str_random(32);
});

Ref : Lumen Laravel

Ok done. thank you.  😆  😆

About Whendy

Whendy Blog mengumpulkan beberapa Tutorial Website, PHP, AngularJS, JQuery, Laravel, Codeigniter dan lain-lain. ( jika sempat ) :)

14 comments

  1. For latest information you have to visit the web and
    on the web I found this website as a best web page for latest updates.

  2. At this moment I am going away to do my breakfast, afterward having my breakfast coming over again to
    read more news.

  3. I know this if off topic but I’m looking into starting my own blog
    and was curious what all is required to get setup?
    I’m assuming having a blog like yours would cost a pretty penny?
    I’m not very web savvy so I’m not 100% sure. Any recommendations
    or advice would be greatly appreciated. Thanks

  4. I every time used to read paragraph in news papers but now as I am a user of internet so from now I am using net
    for articles or reviews, thanks to web.

  5. I’m really inspired together with your writing abilities and
    also with the layout for your weblog. Is that this a paid subject matter or did you
    customize it yourself? Anyway keep up the nice quality writing, it’s uncommon to
    peer a nice weblog like this one nowadays..

  6. I am really impressed together with your writing talents and also with the layout to
    your weblog. Is that this a paid theme or did you modify it your self?

    Either way keep up the excellent quality writing, it is uncommon to peer a nice blog like this one these
    days..

  7. Having read this I believed it was rather informative.
    I appreciate you spending some time and effort to put
    this informative article together. I once again find myself personally spending
    a lot of time both reading and leaving comments. But so what, it was
    still worth it!

  8. It is the best time to make some plans for the future and it
    is time to be happy. I have read this post and if I could I desire to suggest you some interesting things
    or tips. Perhaps you could write next articles referring to this
    article. I desire to read more things about it!

  9. Incase you are working on windows and using maybe like a WAMP/XAMPP, Lumen now lets you determine how you want to serve your project. Follow steps 1, 2, 3 above.

    Ommit number 4, and do this.

    – Open command Prompt.
    – Navigate to your project directory
    – execute this command: “php -S localhost:80 -t ./public”

    You will get a message that your php version has started listening on the port you specified, e.g 80 as above. Now visit http://localhost:port/ in your browser.. You should see:
    Lumen (5.2.7) (Laravel Components 5.2.*)

  10. I don’t know if it’s just me or if perhaps everybody
    else encountering issues with your website.
    It appears as if some of the written text in your posts are running off the screen.
    Can somebody else please comment and let me know if this is happening to them as well?
    This may be a problem with my internet browser because I’ve had this happen before.
    Many thanks

Leave a Reply

Your email address will not be published. Required fields are marked *