In controller which render your blade file put this code ... for example
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class UserController extends Controller
{
/**
* Show the profile for the given user.
*
* @param Request $request
* @param int $id
* @return Response
*/
public function show(Request $request, $id)
{
$value = $request->session()->put('key', 'value');
//
}
}
@TOMOPONGRAC - no i meant, the session that I created in blade, how can I use it in controller?
Should I pass in route ? That it the thing I don't get.
I have this situation. User has to make a booking. If the user is not logged in I have to set a session with the $event->id. Then after he logs in should be redirected to booking form blade.
But I have no idea how to send this session in LoginController... :/