for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Foundation\Abstracts\Repositories;
use Larapie\Repository\Eloquent\BaseRepository;
use Larapie\Repository\Exceptions\RepositoryException;
class Repository extends BaseRepository
{
protected $eloquent;
public function model()
if (!isset($this->eloquent) || !is_string($this->eloquent))
throw new RepositoryException("Model not defined on " . static::class);
return $this->eloquent;
}
public function resolve($id){
if ($id instanceof $this->model) {
return $id;
return $this->model::find($id);