Skip to content

Commit 4adc120

Browse files
committed
feat: update cookies docs
1 parent 5ce47c4 commit 4adc120

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/docs/http/cookies.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ composer require leafs/cookie
2424

2525
Since cookies are sent to the client's browser as part of the response, Leaf provides a direct way to set cookies on your response. You can directly call `withCookie()` on your response object to set a cookie.
2626

27-
```php
27+
```php:no-line-numbers
2828
response()->withCookie('name', 'Fullname');
2929
```
3030

@@ -70,15 +70,15 @@ The `set()` method allows you to set cookies with more advanced options like exp
7070

7171
When you send cookies to the client, they are stored in your users' browser and automatically sent back to your app on every request. You can read these cookies using the `get()` method.
7272

73-
```php
73+
```php:no-line-numbers
7474
$name = cookie()->get('name');
7575
```
7676

7777
This method takes in the cookie name and returns the cookie value. If the cookie doesn't exist, it returns `null`.
7878

7979
You can also get all cookies at once using the `all()` method.
8080

81-
```php
81+
```php:no-line-numbers
8282
$cookies = cookie()->all();
8383
```
8484

@@ -109,6 +109,6 @@ cookie()->delete('name');
109109

110110
You may also choose to delete all your cookies, for instance if you detect an authentication or authorization breech in your application. You can do this using the `deleteAll()` method on Leaf cookies.
111111

112-
```php
112+
```php:no-line-numbers
113113
cookie()->deteleAll();
114114
```

0 commit comments

Comments
 (0)