PHP code example of tyasa81 / dbrepositories

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

    

tyasa81 / dbrepositories example snippets


use tyasa81\DbRepositories\EloquentTrait;
use tyasa81\DbRepositories\RepositoryInterface;
use App\Models\User;

final class UserRepository implements RepositoryInterface
{
    use EloquentTrait;

    private $model;

    public function __construct(?string $connector = null)
    {
        $this->model = new User;
        if ($connector) {
            $this->model = $this->model->on($connector);
        }
    }
}