loading...
Cover image for Create Your Own Lumen Installer (2020)

Create Your Own Lumen Installer (2020)

aibnuhibban profile image Abdullah Ibnu Hibban ・2 min read

Assalamu'alaikum

Alhamdulillah, I can still provide knowledge that may be useful for my friends who read ..

Fine, according to the title. We will create our own version of the Lumen Installer. Not only that, this script will also immediately take the latest version of Lumen .. When this article was written Lumen was already version 8

⚑️Lumen

Little explanation. Lumen is a Micro-Framework belonging to Laravel which is devoted to creating APIs.

πŸ”¨ Creating Lumen Installer

To make Lumen Installer I use Bash so that we can customize more comfortably.

Oh, yes. I made it on Linux, if you are a Windows user, maybe I can adjust it for the settings .. Ok πŸ˜‰

Next .. To create Lumen Installer, here are the steps

  • Open Terminal CTRL + T

  • Create a Folder with a free name .. For example I use the name "bashku"

mkdir bashku
  • Enter into the folder and create a file with the name "lumen"
cd bashku
touch lumen
  • Then edit with nano (If you want to edit with a text editor, go ahead)
nano lumen
  • Paste the following code
#!/bin/bash

if [ "$1" != "" ]; then
    echo "Sedang Dibuatkan Projectnya di Folder $1"
    composer create-project --prefer-dist laravel/lumen "$1"
else
    echo "Sedang DIbuatkan Projectnay di sini"
    composer create-project --prefer-dist laravel/lumen .
fi
  • Press CTRL + X then Y and ENTER

  • After that go back to the * Directory * initial

cd ..
  • and edit . Bashrc
nano .bashrc
  • Paste the following code at the bottom
export PATH="$PATH:$HOME/bashku"

*The example above is because the folder I previously created was "bashku", it can be adjusted to the name of your folder

  • If you have pressed CTRL + X then Y and ENTER

  • then type source .bashrc in the terminal

source .bashrc
  • After that, try when you are terminated by:
lumen myproject

Will create project lumen in myproject directory (create a new folder)

lumen

Will create a lumen project in the current directory

⛅️ Closing

How? If there are problems, please discuss it in the comments column... The Bash script above is a basic bash script and is very easy to understand. πŸ˜ƒ

That's all hopefully useful ...

Thank you πŸ‘Š

Posted on by:

Discussion

pic
Editor guide