1、首先引入

use Illuminate\Support\Facades\Cookie;

2、写入数据

Cookie::queue('test','hello',20);    //队列
Cookie::make('test','hello',20);    //写入

3、获取数据,依赖于 Request,所以我们需要首先引入

use Symfony\Component\HttpFoundation\Request;

4、获取数据

$request->cookie('test');

5、清除cookie

Cookie::forget('test');