Problem with extending page model

Hi,
for reporting purposes I wrote a module extending the Page class.
In this simplified example I want to display the title of the most recent blog article in the “Predigten” folder.

class StatisticsPage extends Page
{
	
  	public function reports(): array
  	{

		$letzteSeiteName = $site->pages()->find('Predigten')->children()->sortBy('Date', 'desc')->first()->title();
			
		return [
			[
				'label' => 'Test',
				'value' => $letzteSeiteName,
			]
    	];
  	}
}

The problem occurs, when I use the line

$letzteSeiteName = $site->pages()->find('Predigten')->children()->sortBy('Date', 'desc')->first()->title();

then the report is just empty.
When I replace this line with

$letzteSeiteName = "Expample"

the report shows “Test: Example” as expected.

The very same line

$letzteSeiteName = $site->pages()->find('Predigten')->children()->sortBy('Date', 'desc')->first()->title();

works in normal page templates just fine.

What’s going on? Can anybody please explain?
Thanks,
Nikolaus

Use $this->site()->find()…

$site is not defined in that context.

Thanks for your quick reply.
But this does not seem to help in my case.

To simplify things, I tried:

<?php
	class StatisticsPage extends Page
	{
  		public function reports(): array
  		{
			$letzteSeiteURL = $this->$site()->url();
			
			return [
				[
					'label' => 'Test',
					'value' => $letzteSeiteURL,
				]
    		];
  		}
	}
?>

Still no success.
Any ideas?

Nikolaus

Not $this->$site() but $this->site() without the Dollar sign!

Sorry, yes, of course, that works.
Thanks again!