PHP code example of motty / laravel-repository

1. Go to this page and download the library: Download motty/laravel-repository 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/ */

    

motty / laravel-repository example snippets


public function all($columns = ['*']);
public function lists($value, $key = null);
public function paginate($perPage = 15, $columns = ['*']);
public function findBy($attribute, $value, $columns = ['*']);
public function findManyBy($attribute, $value, $columns = ['*']);

public function newQuery();

public function with($relations);

public function create(array $attributes);
public function find($id, array $columns = ['*']);
public function update(array $data, $id, $attribute = 'id');
public function delete($ids = null);

public function skipCriteria($status = true);
public function getCriteria();
public function getByCriteria(BaseCriteria $criteria);
public function pushCriteria(BaseCriteria $criteria);
public function applyCriteria();