From 08fb3eb5a4ac112be2e679d1fc07f32052b3afa2 Mon Sep 17 00:00:00 2001 From: salehhashemi1992 <81674631+salehhashemi1992@users.noreply.github.com> Date: Wed, 6 Dec 2023 13:06:40 +0330 Subject: [PATCH] update readme file --- README.md | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 05f511c..71fc997 100644 --- a/README.md +++ b/README.md @@ -1 +1,78 @@ -# laravel-repository \ No newline at end of file +
+ +# Laravel Repository Pattern + +[![Latest Version on Packagist](https://img.shields.io/packagist/v/salehhashemi/laravel-repository.svg?style=flat-square)](https://packagist.org/packages/salehhashemi/laravel-repository) +[![Total Downloads](https://img.shields.io/packagist/dt/salehhashemi/laravel-repository.svg?style=flat-square)](https://packagist.org/packages/salehhashemi/laravel-repository) +[![GitHub Actions](https://img.shields.io/github/actions/workflow/status/salehhashemi1992/laravel-repository/static-analysis.yml?branch=main&label=static-analysis)](https://github.com/salehhashemi1992/laravel-repository/actions/workflows/static-analysis.yml) +[![PHPStan](https://img.shields.io/badge/PHPStan-level%208-brightgreen.svg?style=flat)](https://phpstan.org/) + +
+ +This Laravel package abstracts the database layer using repository pattern with enhanced capabilities for filtering and searching. It simplifies the common tasks of data manipulation, along with advanced features for applying custom filters and search criteria. + +## Features +* Repository Abstraction +* Dynamic Filtering +* Search Functionality + +## Installation +To install the package, you can run the following command: +```bash +composer require salehhashemi/laravel-repository +``` + +## Configuration +To publish the config file, run the following command: +```bash +php artisan vendor:publish --provider="Salehhashemi\Repository\RepositoryServiceProvider" --tag="config" +``` +After publishing, make sure to clear the config cache to apply your changes: +```bash +php artisan config:clear +``` +Then, you can adjust the pagination limit in the `config/otp.php` + +### Exceptions +* `\InvalidArgumentException` Thrown if page size is invalid. + +## Docker Setup +This project uses Docker for local development and testing. Make sure you have Docker and Docker Compose installed on your system before proceeding. + +### Build the Docker images +```bash +docker-compose build +``` + +### Start the services +```bash +docker-compose up -d +``` +To access the PHP container, you can use: +```bash +docker-compose exec php bash +``` + +### Testing + +```bash +composer test +``` + +### Changelog + +Please see [CHANGELOG](changelog.md) for more information what has changed recently. + +## Contributing + +Please see [CONTRIBUTING](contributing.md) for details. + +## Credits + +- [Saleh Hashemi](https://github.com/salehhashemi1992) +- [IMahmood](https://github.com/imahmood) +- [All Contributors](../../contributors) + +## License + +The MIT License (MIT). Please see [License File](license.md) for more information. \ No newline at end of file