update deploy
This commit is contained in:
37
app/Repositories/Contracts/BaseRepositoryInterface.php
Normal file
37
app/Repositories/Contracts/BaseRepositoryInterface.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Contracts;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @template T of Model
|
||||
*/
|
||||
interface BaseRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $filters
|
||||
* @return LengthAwarePaginator<int, T>
|
||||
*/
|
||||
public function paginate(array $filters = [], int $perPage = 15): LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @return T|null
|
||||
*/
|
||||
public function findById(int $id): ?Model;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
* @return T
|
||||
*/
|
||||
public function create(array $data): Model;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
* @return T
|
||||
*/
|
||||
public function update(Model $model, array $data): Model;
|
||||
|
||||
public function delete(Model $model): bool;
|
||||
}
|
||||
Reference in New Issue
Block a user