我正在尝试在刀片中发送会话数据。在注销之前,我创建一个会话。在刀片中创建会话的数据发送。我该如何做到这一点。
public function userLogout()
{
if (!empty(session("userLoggedIn")) && session("userLoggedIn") == true) {
$session = session()->get('userDetails');
$user_id = $session->id;
$user_package = UserPackage::all()->where('user_id','=',$user_id);
foreach($user_package as $package_id) {
$package_detail = Package::where('id','=',$package_id->package_id)->get();
foreach( $package_detail as $package ){
$package_amount = $package->price;
$package_tagline = $package->tagline;
}
}
session()->flush();
session()->save();
}
return redirect()->route('frontend-home')->with('session', session()->put('package_detail',[$package_tagline,$package_amount]));
}
我尝试后这个结果什么也没有。以及如何将会话的数据打印在刀片上
波斯汪
慕的地6264312