Download the PHP package bilaliqbalr/laravel-redis without Composer
On this page you can find all versions of the php package bilaliqbalr/laravel-redis. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bilaliqbalr/laravel-redis
More information about bilaliqbalr/laravel-redis
Files in bilaliqbalr/laravel-redis
Package laravel-redis
Short Description This package will provide redis based laravel auth driver
License MIT
Homepage https://github.com/bilaliqbalr/laravel-redis
Informations about the package laravel-redis
Laravel Redis
As name suggested this package will let you use Redis as a database instead of using it just for caching purpose. It works almost the same way as using Laravel Eloquent but with some differences. With this package forget the pain of naming keys and managing them in Redis. Some of the core features are as follows:
- No need to create migration files, just provide required columns in
$fillable
and this package will take care of the rest - Perform CRUD operations just like doing them in Laravel
- Search model functionality
- Managing relations
-
Laravel auth backed by Redis
Installation
You can install the package via composer:
You can publish the config file with:
Usage
To create new redis model run this command
Prefixes
Prefixes are used to maintain the key structure for specific model, this package creates prefixes by default using Model name, and in case you want to change it you can do this as follow
Change connection
You can change redis connection in model as well
Searching model by specific column
In case you need to get model based on specific field, you can do this by using $searchBy
where you just need to specify column names in the list and this package will store a new key value pair
where key is {model}:column:%s
(%s
is the column value) where value will be the model id to fetch required model.
To get model based on that title field, you can do this as follows
Other operations like create, update and delete works same as in Laravel
Get all records keys
Add new searchBy fields
If you need to add new searchBy field after you have records in your redis database, then you need to run this command to make old records searchable with new column
Managing model relations
With this package you can even create relation between models but that is not like the one in Laravel, as redis is not a relational database.
Auth
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
- Bilal Iqbal
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-redis with dependencies
illuminate/contracts Version ^8.61|^9.0
illuminate/support Version ^8.61|^9.0
predis/predis Version ^1.1
spatie/laravel-package-tools Version ^1.4.3