PHP code example of dlx-llc / laravel-repository
1. Go to this page and download the library: Download dlx-llc/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/ */
dlx-llc / laravel-repository example snippets
use Deluxetech\LaRepo\Facades\LaRepo;
use Deluxetech\LaRepo\Eloquent\GenericRepository;
use Deluxetech\LaRepo\Contracts\RepositoryContract;
class UserController
{
protected RepositoryContract $repo;
public function __construct()
{
$this->repo = new GenericRepository(User::class);
}
public function index()
{
return LaRepo::getManyWithRequest($this->repo);
}
}
php artisan vendor:publish --tag=larepo-config