Skip to content

Instantly share code, notes, and snippets.

@ipabz
Created July 12, 2017 13:52
Show Gist options
  • Save ipabz/506f03f59995476a66922181baba4fc4 to your computer and use it in GitHub Desktop.
Save ipabz/506f03f59995476a66922181baba4fc4 to your computer and use it in GitHub Desktop.
Repository
<?php
namespace Backfence\Repositories;
use Illuminate\Database\Eloquent\Model;
use Backfence\Contracts\YourClassNameInterface;
class YourClassName extends Repository implements YourClassNameInterface
{
protected $model;
public function __construct(Model $model)
{
$this->model = $model;
}
public function __call($method, $args)
{
return call_user_func_array([$this->model, $method], $args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment