RequestBrosurService
in package
uses
HasResource
Table of Contents
Properties
- $model : Model
Methods
- __construct() : mixed
- all() : Collection
- Retrieve all records for the authenticated user, with optional search.
- create() : Model
- Create a new record with the given data.
- delete() : bool
- Delete a record by ID.
- find() : Model|null
- Find a record by ID for the authenticated user.
- findBy() : Model|null
- Find a record by a specific field and value.
- getBy() : Collection
- Get records by a specific field and value.
- paginate() : LengthAwarePaginator
- Paginate records for the authenticated user, with optional search and sorting.
- query() : Builder
- Get a new query builder instance for the model.
- update() : Model|null
- Update a record by ID with the given data.
Properties
$model
private
Model
$model
Methods
__construct()
public
__construct() : mixed
all()
Retrieve all records for the authenticated user, with optional search.
public
all([array<string|int, mixed> $search = [] ]) : Collection
Parameters
- $search : array<string|int, mixed> = []
-
Search options.
Return values
Collection —The collection of records.
create()
Create a new record with the given data.
public
create(array<string|int, mixed> $data) : Model
Parameters
- $data : array<string|int, mixed>
-
The data for the new record.
Return values
Model —The created model.
delete()
Delete a record by ID.
public
delete(int $id) : bool
Parameters
- $id : int
-
The record ID.
Return values
bool —True if deleted, false otherwise.
find()
Find a record by ID for the authenticated user.
public
find(int $id) : Model|null
Parameters
- $id : int
-
The record ID.
Return values
Model|null —The found model or null.
findBy()
Find a record by a specific field and value.
public
findBy(string $field, mixed $value) : Model|null
Parameters
- $field : string
-
The field name.
- $value : mixed
-
The value to search for.
Return values
Model|null —The found model or null.
getBy()
Get records by a specific field and value.
public
getBy(string $field, mixed $value) : Collection
Parameters
- $field : string
-
The field name.
- $value : mixed
-
The value to search for.
Return values
Collection —The collection of records.
paginate()
Paginate records for the authenticated user, with optional search and sorting.
public
paginate([int $perPage = 15 ][, array<string|int, mixed> $search = [] ][, array<string|int, mixed> $sort = [] ]) : LengthAwarePaginator
Parameters
- $perPage : int = 15
-
Number of records per page.
- $search : array<string|int, mixed> = []
-
Search options.
- $sort : array<string|int, mixed> = []
-
Sort options.
Return values
LengthAwarePaginator —Paginated result set.
query()
Get a new query builder instance for the model.
public
query() : Builder
Return values
Builder —The query builder instance.
update()
Update a record by ID with the given data.
public
update(int $id, array<string|int, mixed> $data) : Model|null
Parameters
- $id : int
-
The record ID.
- $data : array<string|int, mixed>
-
The data to update.
Return values
Model|null —The updated model or null.