Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Laravel and PHP Collator class

Why I can’t use PHP Collator class in my Laravel controller (Laravel 8)?

When I use $collator = new Collator('sl_SI'); in config or view file it works OK, but when I try using it in controller I get error:

Call to undefined function App\Http\Controllers\Myapp\Collator()

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Any suggestions?

>Solution :

I would guess you forgot to add the namespace `use \Collator;’ at the top of your Controller.

If that isn’t working, you should add some code examples.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading