Skip to content

Commit 34069f8

Browse files
committed
Add controller
1 parent c2059e5 commit 34069f8

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Native\Laravel\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
7+
class CreateSecurityCookieController
8+
{
9+
public function __invoke(Request $request)
10+
{
11+
if ($request->get('secret') !== config('native-php.secret')) {
12+
return abort(403);
13+
}
14+
15+
return redirect('/')->cookie(cookie(
16+
name: '_php_native',
17+
value: config('native-php.secret'),
18+
domain: 'localhost',
19+
httpOnly: true,
20+
));
21+
}
22+
}

0 commit comments

Comments
 (0)