Skip to content

Instantly share code, notes, and snippets.

@zofe
zofe / RouteServiceProvider.php
Last active October 12, 2018 14:31
customized version of RouteServiceProvider (Laravel 5.6+) to enable dinamically a prefix (/{lang}/route-name) to support multilanguage, and keeping no prefix for default language.
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**

Install Supervisor with sudo apt-get install supervisor in Unix or brew install supervisor in Mac OSX. Ensure it's started with sudo service supervisor restart in Unix or brew services start supervisor in Mac OSX.

In Unix in /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

In Mac OSX first run supervisord -c /usr/local/etc/supervisord.ini and in /usr/local/etc/supervisor.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread in Unix and with: brew services restart supervisor in MAc OSX . And start using those changes with: sudo supervisorctl update.

@zofe
zofe / docker-compose-proxy.md
Last active February 11, 2020 09:32
Host multiple websites with docker-compose & nginx reverse proxy

docker-compose + nginx reverse proxy

local & stage development with docker-compose & nginx-proxy to host multiple websites on a stage server

two environments: local & stage ( with multiple domains on stage using proxy network)

software needed: docker + docker-compose

ref: https://blog.ssdnodes.com/blog/host-multiple-websites-docker-nginx/