Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f666769 commit d16d250Copy full SHA for d16d250
2 files changed
src/Illuminate/Cookie/CookieJar.php
@@ -73,6 +73,17 @@ public function forget($name)
73
return $this->make($name, null, -2628000);
74
}
75
76
+ /**
77
+ * Determine if a cookie has been queued.
78
+ *
79
+ * @param string $key
80
+ * @return bool
81
+ */
82
+ public function hasQueued($key)
83
+ {
84
+ return ! is_null($this->queued($key));
85
+ }
86
+
87
/**
88
* Get a queued cookie instance.
89
*
src/Illuminate/Support/Facades/Cookie.php
@@ -5,6 +5,18 @@
5
*/
6
class Cookie extends Facade {
7
8
9
+ * Determine if a cookie exists on the request.
10
11
12
13
14
+ public static function has($key)
15
16
+ return ! is_null(static::$app['request']->cookie($key, null)) &&
17
+ ! static::hasQueued($key);
18
19
20
21
* Retrieve a cookie from the request.
22
0 commit comments