Skip to content

Instantly share code, notes, and snippets.

# Конфигурация для HTTP-сервера
server {
# Указываем доменное имя
server_name new-automation.ru;
# Путь к корневой директории сайта
root /var/www/opencart/public_html;
# Указываем, какие файлы должны обрабатываться при запросе корня сайта
index index.php index.html
@devig
devig / nginx.conf
Created February 17, 2022 22:05 — forked from morhekil/nginx.conf
Full request/response body logging in nginx
http {
log_format bodylog '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time '
'<"$request_body" >"$resp_body"';
lua_need_request_body on;
set $resp_body "";
body_filter_by_lua '
@devig
devig / ModelJoinTrait.php
Created February 29, 2020 13:08 — forked from pionl/ModelJoinTrait.php
Model join trait with Automatic Join on Laravel 5 Eloquent Models with relations setup. With automatic filling relation object if detected
<?php
namespace Pion\Traits\Models;
use Illuminate\Database\Query\Expression;
use Illuminate\Support\Str;
/**
* Class ModelJoinTrait
*
* Trait to create model join for scope with detection of model in the attributes.
@devig
devig / helper.php
Last active February 29, 2020 12:38 — forked from Ellrion/helper.php
Посмотреть запрос с параметрами
<?php
if (! function_exists('dqd')) {
/**
* Dump info about query in builder and end the script.
*
* @param $query
* @param bool $short
*/
function dqd($query, $short = false)
@devig
devig / unit-of-work.php
Created November 1, 2019 15:18 — forked from voronkovich/unit-of-work.php
Unit of work example
<?php
class Tweet
{
private $id;
private $content;
public function __construct(int $id, string $content)
{
$this->id = $id;