Skip to content

Commit 3489705

Browse files
update
1 parent 8fc0778 commit 3489705

File tree

2 files changed

+57
-2
lines changed

2 files changed

+57
-2
lines changed

Cookie.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static public function set($name, $value = null, $minutes = 0, $path = null, $do
109109
*
110110
* @param string $name
111111
* @param string|null $path
112-
* @param string $domain
112+
* @param string|null $domain
113113
* @return void
114114
*/
115115
static public function forget($name, $path = null, $domain = null)
@@ -179,7 +179,8 @@ static public function getExpire()
179179
}
180180

181181
/**
182-
* Cookie has value
182+
* Cookie has name that exists
183+
*
183184
* @param string $name
184185
* - Cookie name
185186
*

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,63 @@ TameZip()->download('newData.zip')
119119

120120
## Time
121121

122+
```
123+
Visit the Tests/ folder to see more examples.
124+
```
122125

123126
## Cookie
124127

128+
| function name | Description |
129+
|-----------------|-----------------------------|
130+
| set() | Used to set cookie |
131+
| get() | Used to get cookie |
132+
| forget() | Used to expire cookie |
133+
| exire() | Same as `forget` method |
134+
| all() | Get all available cookie |
135+
| has() | Cookie exists |
136+
137+
138+
### Set
139+
- Takes `7 param`
140+
- Mandatory `$name` param as `string`
141+
- [optional] `$value` param as `string \| null`
142+
- [optional] `$minutes` param as `int \| string`
143+
- [optional] `$path` param as `string \| null`
144+
- [optional] `$domain` param as `string \| null`
145+
- [optional] `$secure` param as `bool \| null`
146+
- [optional] `$httponly` param as `bool \| null`
147+
148+
```
149+
Cookie::set('cookie_name', 'value');
150+
```
151+
152+
### Get
153+
- Takes param as `string`
154+
155+
```
156+
Cookie::get('cookie_name');
157+
```
158+
159+
### Forget
160+
- Takes `3 param`
161+
- Mandatory `$name` param as `string`
162+
- [optional] `$path` param as `string \| null`
163+
- [optional] `$domain` param as `string \| null`
164+
165+
```
166+
Cookie::forget('cookie_name');
167+
```
168+
169+
### Has
170+
- Takes param as `string`
171+
- Returns `bool`
172+
173+
```
174+
if(Cookie::has('cookie_name')){
175+
// execute code
176+
}
177+
```
178+
125179

126180
## Asset
127181
- Takes a param as `string` path to asset file

0 commit comments

Comments
 (0)