0

How would I go around using this class/library in Laravel: https://github.com/planetteamspeak/ts3phpframework

I tried to include it in config/app.php providers like this:

planetteamspeak\ts3-php-framework\libraries\TeamSpeak3.php::class,

But I keep getting this error, and I couldn't find anything about it that helped me. I also tried to add it without .php at the end but that doesn't help either.

Fatal error: Uncaught ReflectionException: Class log does not exist in PATH-HERE\vendor\laravel\framework\src\Illuminate\Container\Container.php:734

I'll appreciate any help, thanks!

Ron Melkhior
  • 435
  • 2
  • 4
  • 13

1 Answers1

1

To use your class/library in Laravel, first you should put in your composer.json dependecy for that ts3phpframework

"require": {
"planetteamspeak/ts3phpframework" : "1.*"
}

Inside file app.php you need to do 2 things (something like this, dunno the proper name of alias and provider (be sure to do composer update before doing it)

First add provider (just a hint how to do it)

'providers' => [
ts3phpframework/ts3phpframeworkProvider::class
]

Second add alias (just a hint how to do it)

'aliases' => [
'ts3phpframework' => ts3phpframework\Facades\ts3phpframework::class,
]

If you won't be able to get this library with composer, then add it manually with a help of this. If you won't be able to find alias and provider, then create them manually with a help of this.

And at the end, very similar question already answered here

Community
  • 1
  • 1
KuKeC
  • 4,392
  • 5
  • 31
  • 60
  • I already added it to composer.json, it's just when adding it to app.php it fails and gives out the error I mentioned in the OP. Also edited it now to show how I added it to providers. – Ron Melkhior Jul 14 '16 at 10:27