-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPost.php
More file actions
34 lines (31 loc) · 748 Bytes
/
Post.php
File metadata and controls
34 lines (31 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
namespace Neuron\Routing\Attributes;
use Attribute;
/**
* POST route attribute for defining POST HTTP routes on controller methods.
*
* @package Neuron\Routing\Attributes
*
* @example
* ```php
* #[Post('/users', filters: ['csrf'])]
* public function store() { }
* ```
*/
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
class Post extends Route
{
/**
* @param string $path The route path (e.g., '/users')
* @param string|null $name Optional route name for URL generation
* @param array $filters Array of filter names to apply to this route
*/
public function __construct(
string $path,
?string $name = null,
array $filters = []
)
{
parent::__construct( $path, 'POST', $name, $filters );
}
}