jeudi 27 avril 2017

Laravel Structure - dependency injecting a controller

I have a laravel app and have created a SocialMediaController to get the latest posts from twitter and instagram and store them in the database.

I need them to be universally accessible and know I can access it via the IOC.

public function doSomething(App\Http\Controllers\SocialMediaController 
    $SocialMedia) {

    }

However if feels wrong to inject a controller like this. What is be best way to wrap up these methods for global use?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire