Set session variable in laravel
public function xxxxxx(Request $request, $id) {
$request->session()->put('key', 'value');
}
Get session value in laravel
$value = $request->session()->get('key');
Retrieving all data from the session
$data = $request->session()->all();
Checking if An Item Exists In The Session
if ($request->session()->has('users')) {
//
}
Destroying session in Laravel
public function showProfile(Request $request, $id) {
//Deleting Items From The Session
$request->session()->forget('key');
$request->session()->flush();
}
Tuesday, 9 February 2021
Sessions knowledge
Subscribe to:
Post Comments (Atom)
Machine Learning - Potato Leaf Disease Prediction
Step 1: import numpy as np import pandas as pd import splitfolders import matplotlib.pyplot as plt import tensorflow as tf from tensorflow i...
-
Step1: composer create-project laravel/laravel canpac Step2: cd canpac Step3: composer require laravel/ui Step4: php artisan ui bootst...
-
Step 1. In the env file write the code as below. DB_CONNECTION_SECOND=mysql DB_HOST_SECOND=127.0.0.1 DB_PORT_SECOND=3306 DB_DATABASE_SECON...
No comments:
Post a Comment