Pivot tables and many-to-many relationships

Today I want to talk about a feature of Laravel which is really useful but can be potentially difficult to understand at first. Pivot table is an example of intermediate table with relationships between two other “main” tables. Real-life example of pivot tables In official documentation they show the example […]

Первый бот на PHP для ВКонтакте

Здравствуйте, хабровчане. В этой публикации я напишу о том, как сделать своего первго чат-бота для ВКонтакте. Думаю, что опытным программистам это будет не интересно, а вот тем, кто только начинает свой путь, будет интересно, так как я ещё и сам не очень далеко ушёл и понимаю проблемы начинающих. И предупреждаю […]

Спам в календаре Google — как избавиться

Если вы пользуетесь календарем Google на вашем Android устройстве или компьютере, либо другим приложением-календарем, которое синхронизируется с Google, время от времени вы можете получать спам приглашения на мероприятия с сомнительным содержанием, от которых не плохо было бы избавиться. В этой короткой инструкции — о том, как отключить спам в Google […]

Laravel skip model accessor

his is the correct way // that skips mutators $model->getOriginal(‘name’); https://laravel.com/api/5.2/Illuminate/Database/Eloquent/Model.html#method_getOriginal getOriginal() doesn’t just skip mutators, it also returns the «original» value of the field at the time the object was read from the database. So if you have since modified the model’s property, this won’t return your modified value, […]

Cannot start docker container from scratch

FROM scratch is a completely empty filesystem. You have no installed libraries, and no shell (like /bin/sh) included in there. To use this as your base, you’d need a statically linked binary, or you’ll need to install all of the normal tools that are included with a linux distribution. The […]

How to use nginx to proxy to a host requiring authentication?

For example: location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://6.6.6.6:80; proxy_set_header Authorization «Basic a2luZzppc25ha2Vk»; } «a2luZzppc25ha2Vk» is «king:isnaked» base64 encoded, so that would work for

Laravel: Has Many Through Pivot… elegantly

Laravel Relationships pretty much cover everything that a model can access. We have One-To-One, One-To-Many, Many to Many, Polymorphic relations, etc. But there is one relation that is not covered because it’s very niche: Has Many Through Pivot. Has Many Through Pivot means: accessing a distant “one to many” relationship […]

9 Common Dockerfile Mistakes

We work with Dockerfiles on a daily basis; all the code we run for ourselves and for our customers, we run from a set of Dockerfiles. In this article, we’ll talk about what mistakes people commonly make, and how to write them better. For those of you who are Docker […]

A Complete List Of Laravel Events

One of the best features of the Laravel framework is the ability to extend or change it’s core components. And to make it even more flexible, Laravel also includes a simple observer implementation where you can subscribe to and listen for events that occur in your application. Today, I’m going […]