Header Ads

Breaking News
recent

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.




[caption id="attachment_409" align="aligncenter" width="302"]env-lumen-laravel env-lumen-laravel[/caption]

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.  :lol:  :lol:

5 comments:

  1. I don't know about what you mean ?
    "It appears as if some of the written text in your posts are running off the screen."
    for me mediocre. :)

    ReplyDelete
  2. 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.*)

    ReplyDelete
  3. @IgnlaOmotayo : thank u, i want edit this post for add your tips for point no 4 :)

    ReplyDelete
  4. 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!

    ReplyDelete
  5. Thanks your attention.
    I have not had time to continue my writing. :)

    ReplyDelete

Powered by Blogger.