first change

This commit is contained in:
2025-07-27 17:40:56 +05:45
commit f8b9a6725b
3152 changed files with 229528 additions and 0 deletions

View File

@@ -0,0 +1,92 @@
<?php
namespace Modules\Sitemap\Interfaces;
use Illuminate\Http\Request;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
interface ModelInterface
{
/**
* Retrieve all records with optional filtering, pagination, and custom query modifications.
*
* @param Request|null $request HTTP request containing filters or parameters
* @param callable|null $query Callback to modify the query (e.g., add joins or where clauses)
* @param bool $paginate Whether to paginate the results
* @param int|null $limit Number of records per page if paginated, null for no limit
* @return Collection|mixed
*/
public function findAll(?Request $request = null, ?callable $query = null, bool $paginate = false, ?int $limit = null);
/**
* Find a record by its ID with optional query callback.
*
* @param int $id
* @param callable|null $query
* @param array $columns
* @return Model|null
*/
public function findById(int $id, ?callable $query = null);
/**
* Create a new record.
*
* @param array $data
* @return Model
*/
public function create(array $data);
/**
* Update a record by ID.
*
* @param int $id
* @param array $data
* @return Model|null
*/
public function update(int $id, array $data);
/**
* Delete a record by ID.
*
* @param int $id
* @return bool
*/
public function delete(int $id);
/**
* Pluck values from a column, optionally keyed by another column.
*
* @param string $column
* @param string|null $key
* @param callable|null $query
* @return Collection
*/
public function pluck(string $column, string $key, ?callable $query = null);
// /**
// * Find the first record matching attributes or create it.
// *
// * @param array $attributes
// * @param array $values
// * @return Model
// */
// public function firstOrCreate(array $attributes, array $values = []);
// /**
// * Check if a record exists by ID.
// *
// * @param int|string $id
// * @return bool
// */
// public function exists(int|string $id): bool;
// /**
// * Count records matching a condition.
// *
// * @param array $conditions
// * @param callable|null $query
// * @return int
// */
// public function count(array $conditions = [], ?callable $query = null);
}