Skip to content

Instantly share code, notes, and snippets.

View morloderex's full-sized avatar

Michael Lundbøl morloderex

View GitHub Profile
public function createTenantConnection(Tenant $tenant)
{
$tenantManager = $this->getTenantManager($tenant);
// Create the database connection.
$based_on = $this->getBaseConnection($connectionName);
$currentConfig = $this->app['config']['database.connections.' . $based_on];
$mergedConfig = array_replace($currentConfig, $tenantManager->createTenantConnection($tenant, $currentConfig) ?? []);
@morloderex
morloderex / apt.log
Created December 14, 2017 18:38
installing of ppa:php-qa on ubuntu 16.04
apt-get install -y language-pack-en-base
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
grub-pc-bin
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
language-pack-en
The following NEW packages will be installed:
Illuminate\Tests\Auth\Gate
[x] gate throws exception on invalid callback type
[x] basic closures can be defined
[x] resource gates can be defined
[x] custom resource gates can be defined
[x] before callbacks can override result if necessary
[x] before callbacks dont interrupt gate check if no value is returned
[x] after callbacks are called with result
[x] current user that is on gate always injected into closure callbacks
[x] a single argument can be passed when checking abilities
@morloderex
morloderex / gist:a3495d50b996f85bd58c484973eb9f71
Created July 26, 2017 07:00
laravel php 72 tests failures
Illuminate\Tests\Auth\Gate
[x] gate throws exception on invalid callback type
[x] basic closures can be defined
[x] resource gates can be defined
[x] custom resource gates can be defined
[x] before callbacks can override result if necessary
[x] before callbacks dont interrupt gate check if no value is returned
[x] after callbacks are called with result
[x] current user that is on gate always injected into closure callbacks
[x] a single argument can be passed when checking abilities
@morloderex
morloderex / flash.php
Last active October 14, 2016 22:40
Very simple flash messinging system
<?php
namespace App\Http;
use Illuminate\Session\SessionInterface;
use InvalidArgumentException;
class Flash
{
protected $session;
@morloderex
morloderex / CacheAdaptor.php
Created January 21, 2016 21:20
Laravel cache Adaptor
<?php
namespace Vitanova\Utilities;
use Illuminate\Contracts\Cache\Repository;
use Psr\Cache\CacheItemInterface;
use Psr\Cache\CacheItemPoolInterface;
use Psr\Cache\InvalidArgumentException;
@morloderex
morloderex / permissions.php
Created September 22, 2015 09:13
permissions_thinking
<?php
$permissions = [
'forum' => [
'create' => [
'threads',
'posts',
'categories',
'attachments'
],
@morloderex
morloderex / Install log
Created May 29, 2014 14:30
Centminmod initial log
This file has been truncated, but you can view the full file.
*****************************************************
Downloading all required software for install routines.
(B*****************************************************
*************************************************
* Installing Development Tools
(B*************************************************
please wait for yum download and installs to complete.
yum installs in less verbose mode so final install status is only shown..
....