Skip to content

Instantly share code, notes, and snippets.

@thijsvdanker
Created September 14, 2015 19:44
Show Gist options
  • Save thijsvdanker/33cc72bd9e6651947dfd to your computer and use it in GitHub Desktop.
Save thijsvdanker/33cc72bd9e6651947dfd to your computer and use it in GitHub Desktop.
AbstractModel constructor
<?php
namespace HynMe\Framework\Models;
use Illuminate\Database\Eloquent\Model;
use ReflectionClass;
use Request;
class AbstractModel extends Model
{
protected $connection;
public function __construct(array $attributes = [])
{
$this->connection = $this->getConnectionName();
parent::__construct($attributes);
}
//.....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment