Search
 
SCRIPT & CODE EXAMPLE
 

PHP

session() in lumen

// Save Session
$router->get('/', function (IlluminateHttpRequest $request) {

    $request->session()->put('name', 'Lumen-Session');

    return response()->json([
        'session.name' => $request->session()->get('name')
    ]);
});


// Test session
$router->get('/session', function (IlluminateHttpRequest $request) {

    return response()->json([
        'session.name' => $request->session()->get('name'),
    ]);
});
Comment

PREVIOUS NEXT
Code Example
Php :: magento2 get full details of order collection 
Php :: laravel get view variables 
Php :: laravel request has 
Php :: laravel auth 
Php :: datatable filters 
Php :: Set a minimum subtotal amount in Woocommerce cart 
Php :: php artisan add row in table 
Php :: drop table phpmyadmin 
Php :: laravel eloquent bulk insert 
Php :: acf sub_field image title 
Php :: laravel with and where 
Php :: codeigniter 4 delete redirect with data 
Php :: php foreach loop 
Php :: job execute async laravel 
Php :: script inside php 
Php :: get all users created in a month laravel 
Php :: Syntax error or access violation: 1071 Specified key was too long; max key length 
Php :: laravel use config 
Php :: autoload.php 
Php :: yii2 gridview action change urls 
Php :: alert for empty input in php 
Php :: woocommerce get shipping classes 
Php :: smarty php 
Php :: php execute a background process 
Php :: php copy array 
Php :: php switch case greater than 
Php :: Program for factorial of a number in php 
Php :: acosh php 
Php :: How do i multiple variables in php 
Php :: use session in laravel 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =