Level 27
@jackjones Yes, this definitely is your typical service provider. There is nothing wrong there. Good luck!
Summer Sale! All accounts are 50% off this week.
I'm completely self taught at PHP and Laravel but I'm trying to develop something that later maybe other people will help with (they're currently doing Laravel for their job but they're junior developers in training and only started two weeks ago so they can't really help atm)
Here is what it looks like
<?php
namespace App\Providers;
use App\Contracts\Extractors\WikidataExtractorContract;
use App\Contracts\Translation\TranslationContract;
use App\Models\Translation;
use App\Services\Translation\TranslationService;
use Illuminate\Support\ServiceProvider;
class TranslationServiceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register()
{
$this->app->bind(TranslationContract::class, function ($app) {
return new TranslationService(new Translation, $app[WikidataExtractorContract::class]);
});
$this->app->alias(TranslationContract::class, 'translation');
}
}
Is that typically what you would expect to see?
Thanks Jack
Please or to participate in this conversation.