toastr icon indicating copy to clipboard operation
toastr copied to clipboard

vscode undefined function toastr()

Open ahmaruff opened this issue 2 years ago • 2 comments

Describe the bug vscode display error Undefined Function 'App\Http\Controllers\toastr'

but it works in browser. (just showing unnecessary error in vscode)

i don't know if this is bug or not. but maybe any suggestion to get rid off this error?

To Reproduce Steps to reproduce the behavior:

  1. install toastr via composer
  2. use toastr() function in any controllers

Expected behavior there is no error in vscode terminal

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Firefox
  • VS Code 1.74.3
  • Laravel 9

Additional context

  • toastr v2.3

ahmaruff avatar Feb 18 '23 15:02 ahmaruff

Hello @ahmaruff, actually this is not an error in PHP, just ignore it or try to use \ and see if the error disappears:

\toastr()->success('Your form has been submitted.');

yoeunes avatar Feb 18 '23 15:02 yoeunes

thanks for your suggestion @yoeunes, but it still display error Undefined function 'toastr'.

ahmaruff avatar Feb 18 '23 15:02 ahmaruff