i make API by laravel passport i wanna save passport token in cookies when login is successful i tried to make this in home controller but it always generate different key
1条回答 默认 最新
- dqcz57269 2018-03-01 22:00关注
Have you tried
withCookie
method of a Response object?use Illuminate\Http\Response; ... $UserToken = Auth::user()->createToken('MyApp')->accessToken; $view = view('Ades Admin.DashBoard'); $response = new Response($view); return $response->withCookie(cookie('valid', $UserToken, 10));
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报