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?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2pCpBnV
via IFTTT

Aucun commentaire:

Enregistrer un commentaire