Skip to content

Adding domain with Resource #143

@lloricode

Description

@lloricode

Hi! We are having an issue when adding domain routes using a Resource.

php: 8.3.8
laravel: 11.13
spatie/laravel-route-attributes: 1.22.1

controller:

#[Resource('test')]
class TestResourceController
{

config: route-attributes

'directories' => [
        app_path('Http/Controllers') => [
            'domain' => env('APP_URL')
        ],

console with error:

lloricode@lloricode:~/Downloads/laravel-11.x$ php artisan route:list

   TypeError 

  preg_match_all(): Argument #2 ($subject) must be of type string, array given

  at vendor/laravel/framework/src/Illuminate/Routing/RouteUri.php:42
     38▕      * @return static
     39▕      */
     40▕     public static function parse($uri)
     41▕     {
  ➜  42▕         preg_match_all('/\{([\w\:]+?)\??\}/', $uri, $matches);
     43▕ 
     44▕         $bindingFields = [];
     45▕ 
     46▕         foreach ($matches[0] as $match) {

      +34 vendor frames 

  35  [internal]:0
      Illuminate\Foundation\Application::Illuminate\Foundation\{closure}()
      +6 vendor frames 

  42  artisan:13
      Illuminate\Foundation\Application::handleCommand()

here a fresh laravel with just reproduce an issue
repo commit

Regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions