Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/melihovv/eloquent-presence-verifier

Perform presence verification through eloquent Model class instead of DB facade
https://github.com/melihovv/eloquent-presence-verifier

eloquent laravel presence-verification

Last synced: 7 days ago
JSON representation

Perform presence verification through eloquent Model class instead of DB facade

Awesome Lists containing this project

README

        

# Eloquent Presence Verifier

[![GitHub Workflow Status](https://github.com/melihovv/eloquent-presence-verifier/workflows/Run%20tests/badge.svg)](https://github.com/melihovv/eloquent-presence-verifier/actions)
[![styleci](https://styleci.io/repos/103585916/shield)](https://styleci.io/repos/103585916)

[![Packagist](https://img.shields.io/packagist/v/melihovv/eloquent-presence-verifier.svg)](https://packagist.org/packages/melihovv/eloquent-presence-verifier)
[![Packagist](https://poser.pugx.org/melihovv/eloquent-presence-verifier/d/total.svg)](https://packagist.org/packages/melihovv/eloquent-presence-verifier)
[![Packagist](https://img.shields.io/packagist/l/melihovv/eloquent-presence-verifier.svg)](https://packagist.org/packages/melihovv/eloquent-presence-verifier)

Perform presence verification through eloquent Model class instead of DB facade.

## Motivation

Awesome package for database query caching [spiritix/lada-cache](https://github.com/spiritix/lada-cache) demands
that all database queries should be ran from Eloquent Model subclasses which has `LadaCacheTrait`. But if you use
some of the following validations rules `exists:users,id` or `unique:users,email` Laravel run queries through `DB`
facade.

## Installation

Install via composer
```
composer require melihovv/eloquent-presence-verifier
```

### Publish Configuration File

```
php artisan vendor:publish --provider="Melihovv\EloquentPresenceVerifier\ServiceProvider" --tag="config"
```

In this config you can specify custom model though which all queries will be send.
For `spiritix/lada-cache` users:

- create `App\Models\TempModel`
```php
\App\Models\TempModel::class,
];
```

## Usage

You don't need to do anything. All is done in this package service provider: EloquentPresenceVerifier is set as default
presence verificator instead of DatabasePresenceVerifier.

## Security

If you discover any security related issues, please email [email protected]
instead of using the issue tracker.

## Credits

- [Alexander Melihov](https://github.com/melihovv/eloquent-presence-verifier)
- [All contributors](https://github.com/melihovv/eloquent-presence-verifier/graphs/contributors)

This package is bootstrapped with the help of [melihovv/laravel-package-generator](https://github.com/melihovv/laravel-package-generator).