Nasrul Hazim Bin Mohamad

Laravel: Package Generator

Dec
31

Assalamualaikum / Hi,

It’s been a long time, I wan to update my Laravel Package Generator and now it’s officially updated with version 2.0.2.

Lots of experience, study case, observation, setting up things in Laravel package. Now I believe, it’s ready to speed up your Laravel Package Development.

So, what the Packager do? Basically it creates a basic skeleton of Laravel package which consist of:

  1. Service Provider
  2. Facade
  3. README – with Installation instruction, License Term ready! Other details you need to update manually.
  4. Dependencies – phpunit/phpunit, orchestra/testbench and codedungeon/phpunit-result-printer
  5. LICENSE
  6. phpunit.xml
  7. helpers

See my tweet on this package

That’s all, thanks!

Lumen: API Development – Episode I

Dec
30

So, this post is about develop your own API using Lumen, a micro framework, a child of the Laravel (I assumed it that way). This topic will take few parts and this is the Episode 1 of Lumen: API Development.

Following tools required to be install on your machine:

  1. Virtual Box – For those using Avira Anti Virus, you might need to head over this article if you having problem with Virtual Box.
  2. Vagrant – Enable developers to easily share the same environment configurations
  3. Composer – Enable developers to manage packages for system dependencies
  4. Git – Famous version control (please do create a GitHub account)
  5. Sublime Text 3 – best text editor I’ve used so far. 🙂

Here are the basic steps taken for setting up the Lumen(all commands running in Git Bash):

  1. Create Lumen project at directory lumen-api
    composer create-project laravel/lumen lumen-api
  2. Install homestead
    cd lumen-api
    composer require laravel/homestead
  3. Make homestead
    php vendor/bin/homestead make

    OR

    php vendor/laravel/homestead/homestead make
  4. Create id_rsa at /C/Users/[yourname]/.ssh
    ssh-keygen -t rsa -C yourname@homestead

    Location of the id_rsa

    Location of the id_rsa

  5. Open Homestead.yaml and change map folder to working directory (step #1)
    map: "D:/WWW/lumen-api"

    homestead.yaml Configuration

    homestead.yaml Configuration

  6. Update C:/Windows/System32/drivers/etc/hosts file
     192.168.10.10 lumen-api.com
  7. install vagrant laravel/homestead (size about 1GB..taking about 45 minutes on 4mbps connection.. T_T)
     vagrant box add laravel/homestead

    Vagrant Add Box Laravel/Homestead

    Vagrant Add Box Laravel/Homestead

  8. Open up Virtual Box & start up the vagrant
     vagrant up
  9. Try to SSH to homestead to check if it’s ok
     ssh vagrant@192.168.10.10 -p 22

    Try to SSH to Homestead

    Try to SSH to Homestead

  10. Browse to lumen-api.com to check if the homestead installed properly

    Test lumen-api.com

    Test lumen-api.com

Development Tools – Personally

Jan
16

I’ve been use the following, to write codes, managing codes, drawing DFD, etc.

  1. Notepad++. I use the following plugins
    1. XML Tools – to linearize / beautify XML 
    2. JsMin – to minify / beautify the javascript
    3. Explorer
  2. FileZilla / WinSCP
  3. WAMP
  4. SQLYog Community
  5. Agent Ransack
  6. Tortoise SVN
  7. Firefox Mozilla
    1. Firebug – Set Net > Disable Browser Cache to true
  8. Putty Connection Manager
  9. Evolus Pencil (Drawing architecture, DRF, etc)
  10. yED

All these tools are the most convenient for me, and it’s fast to load up rather than using some other tools, even more, it’s free. 🙂