Skip to content

Laravel Redis Cache is a caching system provided by the Laravel framework that utilizes Redis as the underlying caching driver. Laravel, a popular PHP web application framework, supports various caching mechanisms to improve application performance, and Redis is one of the supported drivers

Notifications You must be signed in to change notification settings

Minhazulmin/Laravel-Redis-Cache

Repository files navigation

Following the instruction you can run Laravel-Redis in your local machine

Setup local enviroment 🙂

minhazulmin

[Step - 1] Install wsl (windows subsystems for linux):
(Open PowerShell In Your Local Machine and put this command)

wsl - -install

[Step - 2] Check wsl In Your Local Machine:

 wsl -l -v

[Step - 3] Open Linux application on your local machine (ubuntu):

minhazulmin

#Go to this url for below all command:

https://redis.io/docs/getting-started/installation/install-redis-on-windows/
or
[Step - 4] Copy the below command and past on your ubuntu terminal:

curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o/usr/share/keyrings/redis-archive-keyring.gpg

[Step - 5] Copy this command and past on your ubuntu terminal:

sudo apt-get update

[Step - 6] Copy this command and past on your ubuntu terminal for: # Install redis on your local machine

sudo apt-get install redis

[Step - 7] Start redis server on your local machine through this command:

sudo service redis-server start

[Step - 8] Redis terminal open for pink server:

redis-cli

After put this command this url will be open on you terminal 127.0.0.1:6379 >
Write 'pink' like : 127.0.0.1:6379> ping
You will get the result: PONG

[Step - 9] Store Data into Redis

127.0.0.1:6379>set min "minhazul"

Then you will get the result output "ok"

[Step - 10] Get Data into Redis

127.0.0.1:6379>get min

Then you will get the result output "minhazulmin"

Local setup done 👏

[Step - 11] Create laravel new project:

composer create-project laravel/laravel example-app

Or

laravel new example-app

=> Create a laravel project with curd ready
=> Setup database like - name: laravel-redis or as you want

[Step - 12] Get Dummy Data from this url

	https://filldb.info/dummy/step1

=> Create data and export table and import on the mysql database ( Local )
=> Write function on controller and show data and get data in home page

[Step - 13] Open project terminal and Install redis on your project

	composer require predis/predis

[Step - 14] Copy code and push on the project .env

REDIS_CLIENT=predis

[Step - 15] run the command on the project terminal

	php artisan serve

Hit the url

	http://127.0.0.1:8000/

Output: minhazulmin

About

Laravel Redis Cache is a caching system provided by the Laravel framework that utilizes Redis as the underlying caching driver. Laravel, a popular PHP web application framework, supports various caching mechanisms to improve application performance, and Redis is one of the supported drivers

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published