Category: Laravel

New fresh start, many things to end

Starting from today, the plan is to catch up with everything I have missed in the past few years, so there will be a lot of reading and a lot of side projects to learn even more.

The main points which I’ll try to cover while searching for a new opportunity are:

  1. Laravel 5: I did missed a lot of the new things that has happened to Laravel in past few years, I was concentrating on using it more than learning the main components individually, this hopefully will change as I’ll have to put some time to read and check the internal Illuminate components, and maybe build some packages while am doing so.
  2. Docker: yes I’ve talked about me trying to learn Docker a lot in the past, and it was a fun and exciting experience, so now its the time to put what I have learned in more production ready state, to deploy and learn more about how we can use it in production.
  3. Microservices: so in the past few months I spend 99% of my time deploying microservices in the company, which they do one thing only, so now its time for me to read more and see how can I group microservices in one big system that can communicate internally with each other, and yes by utilizing what I have learned about Docker.

So maybe they are a lot of things to do, but now that am on a break I might have the time to do that, and finish also most of the courses that I have bought but never found the time to finish.

Also, if you have any idea which you want someone to help you develop, you can communicate with me via the contact form.

Filed under: Business, docker, Laravel, Personal

[Tip] Connect to multiple databases on the Fly with Lumen

Its not always an easy way to connect to different database if the configuration files does not include any information about it, in older version it was even a tricky one, especially if you have a bit of relationship that you want to use.

Don’t understand from my words that you cant do that, but it was not a direct use of setConnection , from my memory, the setConnection function used to force the connection on the current model only not the children nor any other one that it has a relationship with, when the info for this connection was not part of the database config file.

Things has changed and now in Lumen 5.5 (I didn’t try it with older version), as now you can use the function on to enforce the connection on the Model and any relationship it needs. like the following:

Create a base Model and create a function within called mergeConnections:

Continue reading

Filed under: Code, Laravel, PHP

How to test your Laravel application with Bitbucket Pipelines

Bitbucket Pipelines is a CI service that you can use to test your application, yes it has its own limitation, but remember it is still new and hopefully it will get better. Today I had the chance to work with it, and trust me I was not planning to do so, am a happy Gitlab-ci user, but why not.

Each of these service has its pros and cons, and am not planning to go over it and list it, just do a small reading to find the differences, so today I’ll talk about how to test your Laravel Application with Bitbucket Pipelines and how you can get it fast.

Requirements:

For sure you need to know Laravel and how to write tests, this post will not talk about it, and it would be nice if you know a little bit of Docker.

Enabling Pipelines:

You will need to enable the pipelines from the Repository Settings as the following image

Continue reading

Filed under: Code, docker, Laravel, PHP

How to test and auto deploy your laravel code from Gitlab

Few days ago, I was playing with the new Laravel 5.4 and Gitlab CI, and got to the point where I wanted the CI to test my code once I push it.

Using google lead me to this post on Laracasts, and it was the starting point for me, there you can get important files .gitlab-ci.yml and .gitlab-ci.sh  , basically the first one will define the stages for the testing and the second one will build the environment for your test.

So lets look at a short version of .gitlab-ci.yml

Continue reading

Filed under: Business, Code, docker, Laravel, Linux, MySQL, PHP

Books I need to finish this month or so

This is just a small list of all the books which I was reading and planing to finish them ASAP, they are hanging and I cant figure out a correct time to finish them so hopefully listing them here will help me do it.

  1. Laravel Code Smart ( https://leanpub.com/codesmart/ )
  2. Easy E-Commerce Using Laravel and Stripe ( https://leanpub.com/easyecommerce )
  3. Domain-Driven Design in PHP ( https://leanpub.com/ddd-in-php )
  4. Servers for Hackers ( https://leanpub.com/serversforhackers ) [finished the old one, need to read the new release :( ]

I have started reading only the first and the second book ( sadly ), but am planing to finish and go to finish the list by the end of the next month or so ..

 

Filed under: Books, Code, Laravel, Linux, Nginx, PHP