Skip to content

Artisan command in Listener returns error. #10981

@geertjanknapen1

Description

@geertjanknapen1

Bug description

I'm running into a problem regarding caching routes using Artisan::call upon saving of an Entry in a specific collection.

We have a collection named dynamic_pages, this allows our content-managers to create pages with dynamic URLs (i.e there are no route definitions in web.php for this).

Due to the routes being dynamic, I would like to clear and then cache the routes upon saving of an Entry in this collection.

I've created created a listener that listens to the EntrySaved event, upon save, I check if the Entry being saved is part of the dynamic_pages collection, if that's the case I want to clear and cache the routes again.

Clearing the cache works fine, the issue arises when I try to cache the routes again. This throws a Call to member function can() on null which happens in the Entries.php fieldtype because $user is null. However, I'm calling the command from my code, so why is Statamic expecting a user?

The listener:

public function handle (EntrySaved $event)
{
    Artisan::call('route:clear'); // Works great
    Artisan::call('route:cache'); // Causes the error described above.
}

How to reproduce

Haven't tried this on a fresh site, but seems to me it should work;

  • Create two new collections.
  • Make sure there is an Entries field in the blueprint of one of them, linking to the other.
  • Add an entry into the collection.
  • Set up a listener that listens to EntrySaved events.
  • Use Artisan::call('route:cache') from the listener
  • Observe the error.

Blueprint:

title: 'Dynamic Page'
tabs:
  content:
    display: Content
    sections:
      -
        fields:
          -
            handle: title
            field:
              type: text
              required: true
              localizable: true
              validate:
                - required
              display: Title
              instructions_position: below
              listable: hidden
              visibility: visible
              always_save: false
              placeholder: 'My page title'
              input_type: text
              antlers: false
          -
            handle: excerpt
            field:
              collapse: false
              always_show_set_button: false
              previews: false
              buttons:
                - h1
                - h2
                - h3
                - h4
                - h5
                - h6
                - bold
                - italic
                - unorderedlist
                - orderedlist
                - removeformat
                - quote
                - anchor
                - image
                - table
                - underline
                - strikethrough
                - small
              container: images
              save_html: false
              toolbar_mode: fixed
              link_noopener: false
              link_noreferrer: false
              target_blank: false
              link_collections:
                - pages
              reading_time: true
              fullscreen: true
              allow_source: true
              enable_input_rules: true
              enable_paste_rules: true
              antlers: false
              remove_empty_nodes: false
              display: Excerpt
              type: bard
              icon: bard
              localizable: true
              listable: hidden
              instructions_position: above
              visibility: visible
              always_save: false
              validate:
                - required
          -
            import: general_content_field
  sidebar:
    display: Sidebar
    sections:
      -
        fields:
          -
            handle: slug
            field:
              type: slug
              localizable: false
              display: Slug
              instructions_position: above
              listable: hidden
              visibility: visible
              always_save: false
              from: title
              generate: false
              validate:
                - required
                - 'unique_entry_value:{collection},{id},{site}'
              instructions: 'Page Identifier'
              show_regenerate: false
              hide_display: false
          -
            handle: url
            field:
              input_type: text
              antlers: false
              display: URL
              type: text
              icon: text
              instructions: 'Page URL'
              localizable: true
              listable: hidden
              instructions_position: above
              visibility: visible
              validate:
                - required
          -
            handle: template
            field:
              hide_partials: true
              blueprint: false
              folder: templates
              display: Template
              type: template
              icon: template
              instructions: 'Choose a template for this page'
              localizable: false
              listable: hidden
              instructions_position: above
              visibility: visible
              always_save: false
              validate:
                - required
          -
            handle: hide_newsletter_footer
            field:
              default: false
              type: toggle
              display: 'Hide newsletter footer'
              icon: toggle
              localizable: false
              listable: hidden
              instructions_position: above
              visibility: visible
              hide_display: false
          -
            handle: tags
            field:
              type: terms
              taxonomies:
                - tags
                - grow-styles
              display: Tags
              mode: default
              localizable: false
              instructions_position: above
              listable: hidden
              visibility: visible
              always_save: false
              create: true
          -
            import: general_access_list_field
  media:
    display: Media
    sections:
      -
        fields:
          -
            handle: header_video
            field:
              max_items: 1
              mode: select
              create: true
              collections:
                - videos
              type: entries
              display: 'Header video'
              icon: entries
              instructions: 'Choose the header video for this page (if applicable for the chosen template)'
              localizable: true
              listable: hidden
              instructions_position: above
              visibility: visible
              hide_display: false
              if:
                slug: 'contains_any hobby,commercial,our-universe'
          -
            handle: header_images
            field:
              use_breakpoints: true
              allow_ratio: true
              allow_fit: true
              breakpoints:
                - xs
                - md
                - xl
              container: images
              restrict: false
              allow_uploads: true
              display: 'Header Images'
              type: responsive
              icon: assets
              localizable: false
              listable: hidden
              instructions_position: above
              visibility: visible
              always_save: false
              hide_display: false
              folder: pages
          -
            import: alt_tags_fieldset
            prefix: header_image_
  translations:
    display: Translations
    sections:
      -
        fields:
          -
            import: translations_fieldset
  relations:
    display: Relations
    sections:
      -
        display: Relations
        fields:
          -
            import: related_fieldset

General content fieldset

title: 'General content field'
fields:
  -
    handle: content
    field:
      collapse: false
      always_show_set_button: false
      previews: false
      buttons:
        - h1
        - h2
        - h3
        - h4
        - h5
        - h6
        - horizontalrule
        - bold
        - italic
        - unorderedlist
        - orderedlist
        - removeformat
        - quote
        - anchor
        - image
        - table
        - underline
        - strikethrough
        - small
        - superscript
        - subscript
        - alignleft
        - aligncenter
        - alignright
        - alignjustify
      container: images
      save_html: false
      toolbar_mode: fixed
      link_noopener: false
      link_noreferrer: false
      target_blank: false
      reading_time: true
      fullscreen: true
      allow_source: true
      enable_input_rules: true
      enable_paste_rules: true
      antlers: false
      remove_empty_nodes: false
      display: Content
      type: bard
      localizable: true
      listable: hidden
      instructions_position: above
      visibility: visible
      always_save: false
      validate:
        - required
      sets:
        main:
          display: Main
          instructions: null
          icon: null
          sets:
            slider_set:
              display: 'Slider Set'
              instructions: null
              icon: layout-carousel-horizontal
              fields:
                -
                  handle: slider
                  field:
                    max_items: 1
                    mode: select
                    create: true
                    collections:
                      - sliders
                    display: Slider
                    type: entries
                    instructions: 'Select the slider you want to display'
                    localizable: false
                    listable: hidden
                    instructions_position: above
                    visibility: visible
                    always_save: false
            horizontal_block:
              display: 'Horizontal Block'
              instructions: null
              icon: layout-split-horizontal
              fields:
                -
                  handle: title
                  field:
                    input_type: text
                    antlers: false
                    display: Title
                    type: text
                    localizable: false
                    listable: hidden
                    instructions_position: above
                    visibility: visible
                -
                  handle: text_field
                  field:
                    input_type: text
                    antlers: false
                    display: 'Text Field'
                    type: text
                    localizable: false
                    listable: hidden
                    instructions_position: above
                    visibility: visible
                -
                  handle: partners
                  field:
                    default: false
                    display: Partners
                    type: toggle
                    localizable: false
                    listable: hidden
                    instructions_position: above
                    visibility: visible
                -
                  handle: block
                  field:
                    collapse: false
                    previews: true
                    sets:
                      general:
                        display: General
                        fields:
                          -
                            handle: text
                            field:
                              input_type: text
                              antlers: false
                              display: Text
                              type: text
                              icon: text
                              localizable: false
                              listable: hidden
                              instructions_position: above
                              visibility: visible
                              validate:
                                - required
                          -
                            handle: link
                            field:
                              display: Link
                              type: link
                              icon: link
                              localizable: false
                              listable: hidden
                              instructions_position: above
                              visibility: visible
                          -
                            handle: open_in_new_window
                            field:
                              default: false
                              display: 'Open in new window'
                              type: toggle
                              icon: toggle
                              localizable: false
                              listable: hidden
                              instructions_position: above
                              visibility: visible
                          -
                            handle: images
                            field:
                              use_breakpoints: true
                              allow_ratio: true
                              allow_fit: true
                              breakpoints:
                                - sm
                                - lg
                              restrict: false
                              allow_uploads: true
                              display: Images
                              type: responsive
                              icon: assets
                              localizable: false
                              listable: hidden
                              instructions_position: above
                              visibility: visible
                              container: images
                    display: Block
                    type: replicator
                    localizable: false
                    listable: hidden
                    instructions_position: above
                    visibility: visible
            image_content_block:
              display: 'Image Content Block'
              instructions: null
              icon: media-image-picture-orientation
              fields:
                -
                  handle: image_content_block_title
                  field:
                    input_type: text
                    antlers: false
                    display: 'Image Content Block Title'
                    type: text
                    localizable: false
                    listable: hidden
                    instructions_position: above
                    visibility: visible
                -
                  handle: image_content_block_text
                  field:
                    restrict: false
                    automatic_line_breaks: true
                    automatic_links: false
                    escape_markup: false
                    smartypants: false
                    antlers: false
                    display: 'Image Content Block Text'
                    type: markdown
                    localizable: false
                    listable: hidden
                    instructions_position: above
                    visibility: visible
                -
                  handle: image_content_block_item
                  field:
                    collapse: false
                    previews: true
                    sets:
                      general:
                        display: General
                        fields:
                          -
                            handle: title
                            field:
                              input_type: text
                              antlers: false
                              display: Title
                              type: text
                              icon: text
                              localizable: false
                              listable: hidden
                              instructions_position: above
                              visibility: visible
                          -
                            handle: text
                            field:
                              restrict: false
                              automatic_line_breaks: true
                              automatic_links: false
                              escape_markup: false
                              smartypants: false
                              antlers: false
                              display: Text
                              type: markdown
                              icon: markdown
                              localizable: false
                              listable: hidden
                              instructions_position: above
                              visibility: visible
                          -
                            handle: image
                            field:
                              use_breakpoints: true
                              allow_ratio: true
                              allow_fit: true
                              breakpoints:
                                - lg
                              restrict: false
                              allow_uploads: true
                              display: Image
                              type: responsive
                              icon: assets
                              localizable: false
                              listable: hidden
                              instructions_position: above
                              visibility: visible
                              container: images
                          -
                            handle: cta_text
                            field:
                              input_type: text
                              antlers: false
                              display: 'CTA text'
                              type: text
                              icon: text
                              localizable: false
                              listable: hidden
                              instructions_position: above
                              visibility: visible
                          -
                            handle: cta_link
                            field:
                              display: 'CTA link'
                              type: link
                              icon: link
                              localizable: false
                              listable: hidden
                              instructions_position: above
                              visibility: visible
                          -
                            handle: open_in_new_window
                            field:
                              default: false
                              display: 'Open in new window'
                              type: toggle
                              icon: toggle
                              localizable: false
                              listable: hidden
                              instructions_position: above
                              visibility: visible
                    display: 'Image Content Block Item'
                    type: replicator
                    localizable: false
                    listable: hidden
                    instructions_position: above
                    visibility: visible
            accordion_horizontal:
              display: 'Accordion Horizontal'
              instructions: null
              icon: layout-split-verical
              fields:
                -
                  handle: accordion_item
                  field:
                    collapse: false
                    previews: true
                    sets:
                      general:
                        display: General
                        fields:
                          -
                            handle: images
                            field:
                              mode: list
                              restrict: false
                              allow_uploads: true
                              show_filename: true
                              display: Images
                              type: assets
                              icon: assets
                              localizable: false
                              listable: hidden
                              instructions_position: above
                              visibility: visible
                              container: images
                              max_files: 1
                          -
                            handle: title
                            field:
                              input_type: text
                              antlers: false
                              display: Title
                              type: text
                              icon: text
                              localizable: false
                              listable: hidden
                              instructions_position: above
                              visibility: visible
                          -
                            handle: text
                            field:
                              restrict: false
                              automatic_line_breaks: true
                              automatic_links: false
                              escape_markup: false
                              smartypants: false
                              antlers: false
                              display: Text
                              type: markdown
                              icon: markdown
                              localizable: false
                              listable: hidden
                              instructions_position: above
                              visibility: visible
                    display: 'Accordion item'
                    type: replicator
                    localizable: false
                    listable: hidden
                    instructions_position: above
                    visibility: visible
            form:
              display: Form
              instructions: null
              icon: mail-inbox-content
              fields:
                -
                  handle: content_form
                  field:
                    max_items: 1
                    display: 'Content form'
                    type: form
                    localizable: false
                    listable: hidden
                    instructions_position: above
                    visibility: visible
                    validate:
                      - sometimes
            list_block:
              display: 'List block'
              instructions: null
              icon: file-content-list
              fields:
                -
                  handle: list_content
                  field:
                    buttons:
                      - unorderedlist
                      - orderedlist
                    smart_typography: false
                    save_html: false
                    inline: false
                    toolbar_mode: fixed
                    reading_time: false
                    fullscreen: true
                    allow_source: true
                    enable_input_rules: true
                    enable_paste_rules: true
                    remove_empty_nodes: false
                    antlers: false
                    link_noopener: false
                    link_noreferrer: false
                    target_blank: false
                    always_show_set_button: false
                    collapse: false
                    previews: true
                    type: bard
                    display: 'List content'
                    localizable: true
                    listable: hidden
                    instructions_position: above
                    visibility: visible
                    hide_display: false
            read_more:
              display: 'Read more'
              instructions: null
              icon: layout-flip-down
              fields:
                -
                  handle: read_more_id
                  field:
                    input_type: text
                    antlers: false
                    type: text
                    display: 'Read more id'
                    localizable: false
                    listable: hidden
                    instructions_position: above
                    visibility: visible
                    hide_display: false
                    validate:
                      - required
                    placeholder: readMoreOne
                -
                  handle: read_more_link
                  field:
                    input_type: text
                    antlers: false
                    type: text
                    display: 'Read more link'
                    localizable: false
                    listable: hidden
                    instructions_position: above
                    visibility: visible
                    hide_display: false
                -
                  handle: content_text
                  field:
                    automatic_line_breaks: true
                    automatic_links: false
                    escape_markup: false
                    smartypants: false
                    container: images
                    folder: /
                    restrict: false
                    antlers: false
                    type: markdown
                    display: 'Content text'
                    localizable: true
                    listable: hidden
                    instructions_position: above
                    visibility: visible
                    hide_display: false
      smart_typography: false
      inline: false
      placeholder: 'Image Content Block Bard Text'
      hide_display: false
      replicator_preview: true
      word_count: false

Logs

[2024-10-21 08:55:58] dev.ERROR: Call to a member function can() on null {"exception":"[object] (Error(code: 0): Call to a member function can() on null at /usr/share/nginx/html/vendor/statamic/cms/src/Fieldtypes/Entries.php:278)
[stacktrace]
#0 [internal function]: Statamic\\Fieldtypes\\Entries->Statamic\\Fieldtypes\\{closure}()
#1 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(600): array_map()
#2 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(778): Illuminate\\Support\\Arr::map()
#3 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(404): Illuminate\\Support\\Collection->map()
#4 /usr/share/nginx/html/vendor/statamic/cms/src/Fieldtypes/Entries.php(273): Illuminate\\Support\\Collection->flatMap()
#5 /usr/share/nginx/html/vendor/statamic/cms/src/Fieldtypes/Relationship.php(134): Statamic\\Fieldtypes\\Entries->getCreatables()
#6 /usr/share/nginx/html/vendor/statamic/cms/src/Fieldtypes/Entries.php(432): Statamic\\Fieldtypes\\Relationship->preload()
#7 /usr/share/nginx/html/vendor/statamic/cms/src/Fieldtypes/Link.php(79): Statamic\\Fieldtypes\\Entries->preload()
#8 /usr/share/nginx/html/vendor/statamic/cms/src/Fields/Field.php(417): Statamic\\Fieldtypes\\Link->preload()
#9 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/HigherOrderCollectionProxy.php(60): Statamic\\Fields\\Field->meta()
#10 [internal function]: Illuminate\\Support\\HigherOrderCollectionProxy->Illuminate\\Support\\{closure}()
#11 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(600): array_map()
#12 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(778): Illuminate\\Support\\Arr::map()
#13 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/HigherOrderCollectionProxy.php(59): Illuminate\\Support\\Collection->map()
#14 /usr/share/nginx/html/vendor/statamic/cms/src/Fields/Fields.php(306): Illuminate\\Support\\HigherOrderCollectionProxy->__call()
#15 /usr/share/nginx/html/vendor/statamic/cms/src/Fieldtypes/Replicator.php(202): Statamic\\Fields\\Fields->meta()
#16 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(627): Statamic\\Fieldtypes\\Replicator->Statamic\\Fieldtypes\\{closure}()
#17 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(826): Illuminate\\Support\\Arr::mapWithKeys()
#18 /usr/share/nginx/html/vendor/statamic/cms/src/Fieldtypes/Replicator.php(201): Illuminate\\Support\\Collection->mapWithKeys()
#19 /usr/share/nginx/html/vendor/statamic/cms/src/Fields/Field.php(417): Statamic\\Fieldtypes\\Replicator->preload()
#20 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/HigherOrderCollectionProxy.php(60): Statamic\\Fields\\Field->meta()
#21 [internal function]: Illuminate\\Support\\HigherOrderCollectionProxy->Illuminate\\Support\\{closure}()
#22 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(600): array_map()
#23 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(778): Illuminate\\Support\\Arr::map()
#24 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/HigherOrderCollectionProxy.php(59): Illuminate\\Support\\Collection->map()
#25 /usr/share/nginx/html/vendor/statamic/cms/src/Fields/Fields.php(306): Illuminate\\Support\\HigherOrderCollectionProxy->__call()
#26 /usr/share/nginx/html/vendor/statamic/cms/src/Fieldtypes/Bard.php(562): Statamic\\Fields\\Fields->meta()
#27 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(627): Statamic\\Fieldtypes\\Bard->Statamic\\Fieldtypes\\{closure}()
#28 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(826): Illuminate\\Support\\Arr::mapWithKeys()
#29 /usr/share/nginx/html/vendor/statamic/cms/src/Fieldtypes/Bard.php(559): Illuminate\\Support\\Collection->mapWithKeys()
#30 /usr/share/nginx/html/vendor/statamic/cms/src/Fields/Field.php(417): Statamic\\Fieldtypes\\Bard->preload()
#31 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/HigherOrderCollectionProxy.php(60): Statamic\\Fields\\Field->meta()
#32 [internal function]: Illuminate\\Support\\HigherOrderCollectionProxy->Illuminate\\Support\\{closure}()
#33 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(600): array_map()
#34 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(778): Illuminate\\Support\\Arr::map()
#35 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Collections/HigherOrderCollectionProxy.php(59): Illuminate\\Support\\Collection->map()
#36 /usr/share/nginx/html/vendor/statamic/cms/src/Fields/Fields.php(306): Illuminate\\Support\\HigherOrderCollectionProxy->__call()
#37 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Controllers/CP/Collections/EntriesController.php(484): Statamic\\Fields\\Fields->meta()
#38 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Controllers/CP/Collections/EntriesController.php(264): Statamic\\Http\\Controllers\\CP\\Collections\\EntriesController->extractFromFields()
#39 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Statamic\\Http\\Controllers\\CP\\Collections\\EntriesController->update()
#40 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction()
#41 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(259): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#42 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#43 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(806): Illuminate\\Routing\\Route->run()
#44 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#45 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/DeleteTemporaryFileUploads.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#46 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\DeleteTemporaryFileUploads->handle()
#47 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/CP/AddVaryHeaderToResponse.php(11): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#48 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CP\\AddVaryHeaderToResponse->handle()
#49 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/CP/CountUsers.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#50 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CP\\CountUsers->handle()
#51 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/CP/BootUtilities.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#52 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CP\\BootUtilities->handle()
#53 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/CP/BootPreferences.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#54 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CP\\BootPreferences->handle()
#55 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/CP/BootPermissions.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#56 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CP\\BootPermissions->handle()
#57 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/CP/SelectedSite.php(15): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#58 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CP\\SelectedSite->handle()
#59 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/CP/Localize.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#60 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CP\\Localize->handle()
#61 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/CP/Authorize.php(25): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#62 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CP\\Authorize->handle()
#63 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/CP/AddToasts.php(22): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#64 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CP\\AddToasts->handle()
#65 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/CP/AuthGuard.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#66 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CP\\AuthGuard->handle()
#67 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/CP/ContactOutpost.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#68 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CP\\ContactOutpost->handle()
#69 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#70 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#71 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#72 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#73 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#74 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#75 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#76 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#77 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Session\\Middleware\\StartSession->handle()
#78 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#79 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#80 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#81 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#82 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/SwapExceptionHandler.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#83 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\SwapExceptionHandler->handle()
#84 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#85 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(805): Illuminate\\Pipeline\\Pipeline->then()
#86 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(784): Illuminate\\Routing\\Router->runRouteWithinStack()
#87 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(748): Illuminate\\Routing\\Router->runRoute()
#88 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(737): Illuminate\\Routing\\Router->dispatchToRoute()
#89 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(200): Illuminate\\Routing\\Router->dispatch()
#90 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#91 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/StopImpersonating.php(12): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#92 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\StopImpersonating->handle()
#93 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/DisableFloc.php(17): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#94 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\DisableFloc->handle()
#95 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/CheckMultisite.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#96 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CheckMultisite->handle()
#97 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/CheckComposerJsonScripts.php(14): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#98 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\CheckComposerJsonScripts->handle()
#99 /usr/share/nginx/html/vendor/statamic/cms/src/Http/Middleware/PoweredByHeader.php(18): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#100 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Statamic\\Http\\Middleware\\PoweredByHeader->handle()
#101 /usr/share/nginx/html/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(59): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#102 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle()
#103 /usr/share/nginx/html/vendor/withcandour/aardvark-seo/src/Http/Middleware/RedirectsMiddleware.php(16): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#104 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): WithCandour\\AardvarkSeo\\Http\\Middleware\\RedirectsMiddleware->handle()
#105 /usr/share/nginx/html/app/Http/Middleware/SetGlobalDefaults.php(29): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#106 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\SetGlobalDefaults->handle()
#107 /usr/share/nginx/html/app/Http/Middleware/SetDefaultLocaleForUrls.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#108 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\SetDefaultLocaleForUrls->handle()
#109 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#110 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#111 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#112 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#113 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#114 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#115 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#116 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#117 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(99): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#118 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#119 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#120 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\HandleCors->handle()
#121 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#122 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#123 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustHosts.php(48): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#124 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\TrustHosts->handle()
#125 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#126 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\\Pipeline\\Pipeline->then()
#127 /usr/share/nginx/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#128 /usr/share/nginx/html/public/index.php(51): Illuminate\\Foundation\\Http\\Kernel->handle()
#129 {main}
"}

Environment

Environment
Application Name: myapp
Laravel Version: 10.48.20
PHP Version: 8.3.1
Composer Version: 2.6.6
Environment: dev
Debug Mode: ENABLED
URL: myapp.test
Maintenance Mode: OFF

Cache
Config: CACHED
Events: CACHED
Routes: CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / daily, stderr
Mail: smtp
Queue: redis
Session: file

Statamic
Addons: 5
Antlers: runtime
Sites: 8 (English, Dutch, Spanish, and 5 more)
Stache Watcher: Disabled
Static Caching: half
Version: 4.58.2 PRO

Statamic Addons
appswithlove/statamic-one-click-content-translation: 4.63.0
aryehraber/statamic-impersonator: 2.6.0
spatie/statamic-responsive-images: 4.1.1
statamic-rad-pack/meilisearch: 3.2.1
withcandour/aardvark-seo: 3.0.1

Installation

Existing Laravel app

Additional details

Multisite-setup

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions