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 ::  
Php :: laravel get view variables 
Php :: laravel request has 
Php ::  
Php :: datatable filters 
Php :: Set a minimum subtotal amount in Woocommerce cart 
Php :: php artisan add row in table 
:: drop table phpmyadmin 
Php :: php array differ 
:: php dirpath multiple file extensions 
::  
:: Change date format on view - laravel 
Php :: laravel inline if else if 
Php :: php isset form submit 
Php ::  
Php ::  
Php :: php Program for Sum of the digits of a given number 
Php :: php wpdb foreach 
Php :: php get variable by string name 
Php :: toastr in php 
Php :: two condition in one laravel query 
Php ::  
Php ::  
:: php - = 
Php :: random string number generator in php codeigniter 
Php ::  
:: how to declare global variable in laravel controller 
Php :: set cookie on button click php or js 
::  
::  
ADD CONTENT
Topic
Content
Source link
Name
6+9 =