Gitignore Pattern Explained

0 comments / March 29, 2019

Rules

You find these rules in more depth explained in the official docs.

  1. foo/ matches any folder foo (in any folder inside your git worktree), but no file foo or foo.txt
  2. foo matches any folder foo and file foo (in any folder inside your git worktree) but not files that contain the string, like foo.txt Read more

Pivot tables don’t need an AI column

0 comments / December 8, 2018

Most scenarios are covered by a hasOne, hasMany or ManyToMany relation. How to use them is explained in detail here. I give a brief overview how they are connected to the database.

User hasOne Phone

You should have two tables that look somehow like this:

User Table
id name
1 Bob
Phone Table
user_id phone
1 1234567

From the user class you can access his phone as


 return $this->hasOne('App\Phone','user_id','id');   

Read more

MySQL: Locks & Transactions

0 comments / November 28, 2018

Locking and transactions helps to write programs where multiple user may do simultaneous request. Lets checkout some common scenarios and how to handle them.

Single Statements

Two single queries will never be executed parallel. If you call Read more

Newer