laravel-theme icon indicating copy to clipboard operation
laravel-theme copied to clipboard

AssetContainer could not be converted to string

Open aviqbaihaqy opened this issue 7 years ago • 2 comments

after migrate from teepluss\theme to FaCuZ/laravel-theme, in script

{!! Theme::asset()->container('footer')->usePath()->add('app', 'js/app.js') !!}

i get error:

"Object of class Facuz\Theme\AssetContainer could not be converted to string (View: D:\WWW\barlin\public\themes\default\views\landing.blade.php)"

then result in dd:

AssetContainer {#5927 ▼
  +usePath: true
  +path: null
  +name: "footer"
  +"assets": array:1 [▼
    "script" => array:1 [▼
      "app" => array:3 [▼
        "source" => "public/themes/default/assets/js/app.js"
        "dependencies" => []
        "attributes" => []
      ]
    ]
  ]
}

whats wrong this script?

aviqbaihaqy avatar Sep 07 '18 06:09 aviqbaihaqy

I'm having the exact same issue, did you manage to fix it ?

isbkch avatar Oct 12 '18 21:10 isbkch

@php Theme::asset()->add('app', 'https://example.com/js/app.js') @endphp
@php Theme::asset()->themePath()->add('app', 'js/app.js') @endphp
@php Theme::asset()->container('footer')->themePath()->add('app', 'js/app.js') @endphp

waiyanmintun avatar Apr 06 '19 19:04 waiyanmintun