Do you need to add something like this before your class declaration?
use Your\Path\To\PageRepository as PageRepository;
Hello Sitesense,
Yes, sorry I forgot to paste the first 3 lines of my code. These classes are already in use.
Thank you for your answer. Any other idea? Pedro
Hi Pedro,
The error is saying trying to get property of non-object, so is $this->pageInfo an object?
Try this at the top of your index function:
dd($this->pageInfo);
What is the output?
Perhaps change this line:
//$texts = $this->page->getPageTexts($this->pageInfo->id);
$texts = $this->page->getPageTexts($this->pageInfo['id']);
Just a guess because I don't know what $this->pageInfo is.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community