Developer Workflow automation with Laravel and Github using acacha/llum . Part 1…

Sergi Tur Badenas
4 min readMay 26, 2017

--

Part 2: https://medium.com/@sergiturbadenas/developer-workflow-automation-with-laravel-and-github-using-acacha-llum-part-2-2527b90cd514

If as me,you are a Laravel developer working with Github very likely you are tired of routine tasks (aka Boilerplate/Scaffolding) needed to start a new Laravel project.

Particularly in my case, as a computer science teacher, frequently I’ve to start a lot of little demo projects for my students so, too many times we lose a lot of valuable time scaffolding our projects instead of being focused in learning new topics.

One day I decided to improve our workflow and made acacha/llum package:

as a set of tools to help people improve their developer workflow using Laravel (and other related tools like git). I’m catalan (soon a new state in Europe ;-) https://en.wikipedia.org/wiki/Catalan_independence) and llum means light in my mother language so I thought it was a perfect name to illuminate you Laravel projects!

In this first post I will show you how I use llum to improve my developer workflow.

Talk is cheap show me the code…

Install acacha/llum using composer:

composer global require "acacha/llum"

Thanks to awesome Symfony/Console now you have a new global command installed in your system:

llumAcacha llum illuminates your laravel packages 1.1.2Usage:
command [options] [arguments]
Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-B, --no-bash Does not use bash for modifying config/app.php file. Use stubs instead
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Available commands:
alias Adds a alias/facade to Laravel config/app.php file
boot Execute all common first tasks in laravel project
config Install a config/app.php stub file ready to be used with acacha llum
debugbar Install Laravel Debugbar package
devtools Install development/debug tools: laravel-ide-helper and Laravel Debugbar
help Displays help for a command
idehelper Install Laravel Ide Helper package
init Create ~/.llumrc file with llum configuration data
list Lists commands
migrate execute migrations with php artisan migrate
package Install laravel package from list of supported/known packages names (see config/packages.php file)
provider Adds a provider to Laravel config/app.php file
serve artisan serve with some improvements
service add service or services from file to config/services.php file
sqlite Touch sqlite file and enable sqlite on .env
github
github:init Initializes current folder as a new git project
github:repo Creates a github repo
package
package:list Shows available packages to list (info taken from config/packages.php)
sqlite
sqlite:env Config .env to use sqlite
sqlite:touch Touch database/database.sqlite file

First command to execute will be:

llum initPlease enter your github username (sergi) ?
Do you want to use our assistant to obtain token via Github API (Y/n)?
Github password?

This command will use Github Api to create a personal Token. See:

https://github.com/settings/tokens

The token will be saved at file ~/.llumrc so keep this file secure!

cat ~/.llumrc 
; Llum configuration file
[github]
username = acacha
token = c78342dbca4ec9db2wqwq2272b32a66c3d63423da
token_name = llum_58f9df25aec2f

With this token llum can automate tasks related with Github using Github API. Now we are ready to create a new laravel project:

laravel new awesomeApp
cd awesomeApp

An now (or later if you wish) you can publish your new awesome project in Git with a simple single command:

llum github:init

And ta-dah! new repo is created at Github in my case:

https://github.com/acacha/awesomeApp

Now publishing projects to Github it’s a cinch no more git init, git add -a, git commit, git remote, git pull, git push or checkout commands!

You could also use:

llum github:repo newreponame

to create a new void repo in Github. As you probably already noticed you can use acacha/llum github features not only for your Laravel projects as for all kind of development projects.

Stay in touch to read in part 2 how we can use acacha/llum for more Laravel specific tasks. A a trailer ;-) you can try to execute command:

llum boot

inside your awesomeApp Laravel project …

Bye!

Take a look also to https://github.com/acacha/adminlte-laravel (which uses of course acacha/llum) . Adminlte-laravel is a a Laravel 5 package that switchs default Laravel scaffolding/boilerplate to AdminLTE template and Pratt Landing Page with Bootstrap 3.0.

--

--

Sergi Tur Badenas

Computer Science Teacher and Open Source contributor in my free time. Creator of adminlte-laravel. https://acacha.github.io