How to call public function in .vue

I’m trying to call function in sample app notestutorial in app.vue,
this was added to the app.vue file:

  			<h2>{{ }}</h2>

and in computed part I add this function:

  allnotes() {
  	return this.notes.findAll('testuser')

there is findAll function in files NoteService.php, NoteMapper.php and I add it to the NoteController.php as well:

public function findAll(string $user_id) {
    return $this->service->findAll($user_id);

The result is TypeError: "this.notes.findAll is not a function"

Thank you in advance for any help!

Hello Bob,

you cannot call PHP Controller methods from the client directly. You need to return e.g. a JSON response in your controller, expose your controller method as a route in routes.php and then fetch that URL on the client.

Thank you!