Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use this in Laravel? #2

Closed
rizkysyazuli opened this issue Mar 28, 2019 · 2 comments
Closed

How to use this in Laravel? #2

rizkysyazuli opened this issue Mar 28, 2019 · 2 comments

Comments

@rizkysyazuli
Copy link

I installed the component via composer:

composer require rundiz/number

Then tried to run the function as instructed:

public function TestNumberThai() {
    $number_text = new Rundiz\Number\NumberThai();
    return $number_text->convertNumber('123456');
}

But i'm getting this error:

Class 'App\Http\Controllers\Rundiz\Number\NumberThai' not found

Maybe i haven't properly load the component. But I'm new at Laravel, maybe u can help.

@ve3
Copy link
Contributor

ve3 commented Mar 28, 2019

If you call it inside other namespace\class without fully qualified name (begins with back slash \) the PHP will call any namespace\class related to that class.
read more here
To call with fully qualified name you must begins with back slash like this.. $number_text = new \Rundiz\Number\NumberThai();

@ve3 ve3 closed this as completed Mar 28, 2019
@rizkysyazuli
Copy link
Author

@ve3 works perfectly! thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants