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
Little explanation. Lumen is a Micro-Framework belonging to Laravel which is devoted to creating APIs.
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"
- 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)
- 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
- and edit . Bashrc
- Paste the following code at the bottom
*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
- After that, try when you are terminated by:
Will create project lumen in myproject directory (create a new folder)
Will create a lumen project in the current directory
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 👊