I read this article after upgrading my local dev environment to php8.
And implement it in my class, like:
<<Attribute('foo')>>
public function index()
{
$posts = (new Post)->get()->withMany('image');
return $this->app()->view('index', compact('posts'));
}
and it return error.
syntax error, unexpected token "<<", expecting "function" or "const"
What is really a proper of doing that in php8. Am i missing something?