-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGet.php
More file actions
37 lines (34 loc) · 831 Bytes
/
Get.php
File metadata and controls
37 lines (34 loc) · 831 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
35
36
37
<?php
namespace Neuron\Routing\Attributes;
use Attribute;
/**
* GET route attribute for defining GET HTTP routes on controller methods.
*
* @package Neuron\Routing\Attributes
*
* @example
* ```php
* #[Get('/users')]
* public function index() { }
*
* #[Get('/users/:id', name: 'users.show', filters: ['auth'])]
* public function show(int $id) { }
* ```
*/
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
class Get extends Route
{
/**
* @param string $path The route path (e.g., '/users/:id')
* @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, 'GET', $name, $filters );
}
}