New-Thanasoft/thanasoft-back/app/Repositories/FileRepositoryInterface.php
2025-12-01 17:02:01 +03:00

47 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Repositories;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
use Illuminate\Database\Eloquent\Collection;
interface FileRepositoryInterface extends BaseRepositoryInterface
{
/**
* Get paginated files with filtering
*/
public function paginate(int $perPage = 15, array $filters = []): LengthAwarePaginator;
/**
* Get files by category/type (e.g., devis, facture)
*/
public function getByCategory(string $category, int $perPage = 15): LengthAwarePaginator;
/**
* Get files by client ID
*/
public function getByClient(int $clientId, int $perPage = 15): LengthAwarePaginator;
/**
* Get files by user/uploader
*/
public function getByUploader(int $uploaderId, int $perPage = 15): LengthAwarePaginator;
/**
* Search files by filename or content
*/
public function search(string $searchTerm, int $perPage = 15): LengthAwarePaginator;
/**
* Get recent files
*/
public function getRecent(int $limit = 10): Collection;
/**
* Get files by storage path pattern
*/
public function getByPathPattern(string $pattern, int $perPage = 15): LengthAwarePaginator;
}