Download the PHP package mayankjaviya/lara-finder without Composer
On this page you can find all versions of the php package mayankjaviya/lara-finder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download mayankjaviya/lara-finder
More information about mayankjaviya/lara-finder
Files in mayankjaviya/lara-finder
Download mayankjaviya/lara-finder
More information about mayankjaviya/lara-finder
Files in mayankjaviya/lara-finder
Vendor mayankjaviya
Package lara-finder
Short Description simplify the process of searching for records in a database
License
Package lara-finder
Short Description simplify the process of searching for records in a database
License
Please rate this library. Is it a good library?
Informations about the package lara-finder
LaraFinder 🔍
LaraFinder is a Laravel package designed to simplify the process of searching data from the database. It provides convenient methods to search through specified columns or across all columns of a given model.
Installation
You can install LaraFinder via Composer. Run the following command in your terminal:
Usage
Methods
search($model, $value, $columns)
- Description: Searches for a value in specified columns of the given model.
- Parameters:
$model
: The fully qualified class name of the model to search.$value
: The value to search for.$columns
: An array of column names to search within.
- Return Value: A collection of search results.
searchAll($model, $value)
- Description: Searches for a value across all columns of the given model.
- Parameters:
$model
: The fully qualified class name of the model to search.$value
: The value to search for.
- Return Value: A collection of search results.
searchAllExcept($model, $value, $except)
- Description: Searches for a value across all columns of the given model except for the specified ones.
- Parameters:
$model
: The fully qualified class name of the model to search.$value
: The value to search for.$except
: An array of column names to exclude from the search.
- Return Value: A collection of search results.
searchableColumns($model, $value, $columns = [])
- Description: Searches for a value in specified columns of the given model or in all columns if none are specified.
- Parameters:
$model
: The fully qualified class name of the model to search.$value
: The value to search for.$columns
: (Optional) An array of column names to search within. If not provided, all columns of the model will be searched.
- Return Value: An associative array where each key represents a column name, and the corresponding value is a collection of search results.
searchInMultipleModel($models, $value)
- Description: Allows searching for a specific value across multiple models. It iterates over each model provided in the
$models
array and searches for the value in the specified columns. - Parameters:
$models
: An array of model class names to search within.$value
: The value to search for.
- Return Value: An associative array where each key represents a model class name, and the corresponding value is a query builder instance with the search conditions applied.
searchWithRelation($model, $value, $relation)
- Description: Enables searching for a value within a related model while also considering the main model's attributes. It utilizes eager loading to load related models and performs the search across both the main model and its related model.
- Parameters:
$model
: The main model class name to search within.$value
: The value to search for.$relation
: The related model class name to search within.
- Return Value: A collection of instances of the main model (
$model
) with related models loaded where the search condition is met.
Parameters
$model
: The fully qualified class name of the model to search.$value
: The value to search for.$columns
: (Optional) An array of column names to search within. If not provided, all columns of the model will be searched.$except
: (Optional) An array of column names to exclude from the search.
Contributing
Contributions are welcome! Please feel free to submit pull requests or open issues.
License
This package is open-source software licensed under the MIT license.
All versions of lara-finder with dependencies
PHP Build Version
Package Version
No informations.
The package mayankjaviya/lara-finder contains the following files
Loading the files please wait ....