-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDelete.php
More file actions
34 lines (31 loc) · 783 Bytes
/
Delete.php
File metadata and controls
34 lines (31 loc) · 783 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;
/**
* DELETE route attribute for defining DELETE HTTP routes on controller methods.
*
* @package Neuron\Routing\Attributes
*
* @example
* ```php
* #[Delete('/users/:id', filters: ['auth', 'csrf'])]
* public function destroy(int $id) { }
* ```
*/
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
class Delete 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, 'DELETE', $name, $filters );
}
}