Skip to content

Commit fca95d7

Browse files
committed
produce route attribute issue
Signed-off-by: Lloric Mayuga Garcia <lloricode@gmail.com>
1 parent 0b18a48 commit fca95d7

File tree

4 files changed

+122
-2
lines changed

4 files changed

+122
-2
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Spatie\RouteAttributes\Attributes\Resource;
6+
7+
#[Resource('test')]
8+
class TestResourceController
9+
{
10+
11+
}

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"require": {
88
"php": "^8.2",
99
"laravel/framework": "^11.13",
10-
"laravel/tinker": "^2.9"
10+
"laravel/tinker": "^2.9",
11+
"spatie/laravel-route-attributes": "^1.22.1"
1112
},
1213
"require-dev": {
1314
"fakerphp/faker": "^1.23.1",

composer.lock

Lines changed: 72 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/route-attributes.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
return [
4+
/*
5+
* Automatic registration of routes will only happen if this setting is `true`
6+
*/
7+
'enabled' => true,
8+
9+
/*
10+
* Controllers in these directories that have routing attributes
11+
* will automatically be registered.
12+
*
13+
* Optionally, you can specify group configuration by using key/values
14+
*/
15+
'directories' => [
16+
app_path('Http/Controllers') => [
17+
'domain' => env('APP_URL')
18+
],
19+
/*
20+
app_path('Http/Controllers/Api') => [
21+
'prefix' => 'api',
22+
'middleware' => 'api',
23+
// only register routes in files that match the patterns
24+
'patterns' => ['*Controller.php'],
25+
// do not register routes in files that match the patterns
26+
'not_patterns' => [],
27+
],
28+
*/
29+
],
30+
31+
/**
32+
* This middleware will be applied to all routes.
33+
*/
34+
'middleware' => [
35+
\Illuminate\Routing\Middleware\SubstituteBindings::class
36+
]
37+
];

0 commit comments

Comments
 (0)