I’m trying to do the most basic things in Sage 10 and it’s just not working.
I wanted to try out creating a composers to pass some data to a partial.
Here is my Composer
// app/Composers/ExampleThing.php
<?php
namespace App\Composers;
use Roots\Acorn\View\Composer;
class ExampleThing extends Composer
{
protected static $views = [
'partials.example-partial',
];
public function with($data, $view)
{
return ['example' => "this is the content of a composer."];
}
}
And here is my partial
<!-- resources/views/partials/example-partial.blade.php -->
<div>
{{ $example }}
</div>
But when I try and include the partial anywhere, i get this…
I have no idea what I’m doing wrong because I only adapted code from the docs.