Files
My-KOPKB/be/stubs/nwidart-stubs/repository-interface.stub
ISMAIL MASSERAN 94ecbe5887 first init
2026-06-08 11:37:14 +08:00

45 lines
1.0 KiB
Plaintext

<?php
namespace $CLASS_NAMESPACE$;
use Modules\$MODULE$\Entities\$MODULE$;
use Illuminate\Database\Eloquent\Collection;
interface $CLASS$
{
/**
* Get all $LOWER_NAME$s with pagination and search
*/
public function getAllPaginated(int $perPage = 10, string $search = '');
/**
* Get all $LOWER_NAME$s with their relationships and pagination with search
*/
public function getAllWithRelationsPaginated(int $perPage = 10, string $search = '');
/**
* Get all $LOWER_NAME$s with their relationships and search
*/
public function getAllWithRelations(string $search = ''): Collection;
/**
* Create a new $LOWER_NAME$
*/
public function create(array $data): $MODULE$;
/**
* Find $LOWER_NAME$ by ID
*/
public function findById(int $id): ?$MODULE$;
/**
* Delete $LOWER_NAME$ (soft delete)
*/
public function delete(int $id): bool;
/**
* Get all $LOWER_NAME$s
*/
public function all(string $search = ''): Collection;
}