1. Go to this page and download the library: Download garethnic/repo library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
php
...
use App\Models\Contracts\Repositories\PostRepository;
...
protected $model;
public function __construct(PostRepository $repo)
{
$this->model = $repo;
}
php
public function all($with = [], $orderBy = [], $columns = ['*']);
public function find($id, $relations = []);
public function findBy($attribute, $value, $columns = ['*']);
public function findAllBy($attribute, $value, $columns = ['*']);
public function findWhere($where, $columns = ['*'], $or = false);
public function findWhereIn($field, array $values, $columns = ['*']);
public function paginate($perPage = 25, $columns = ['*']);
public function simplePaginate($limit = null, $columns = ['*']);
public function create($attributes = []);
public function edit($id, $attributes = []);
public function delete($id);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.