mercredi 19 juin 2019

Implement adpater design pattern in laravel application

I tried to implement adapter design pattern in my laravel application. I had to use more than cloud to upload images ex.(google cloud storage, amazon s3).

1- I created an interface called ImageUploderInterface.

2- I created to classes AmazonCloudFrontService class and GoogleCloudStorageService each one of them implement ImageUploderInterface.

3- I created service provider to register my interface and return specific object from one class (AmazonCloudFrontService OR GoogleCloudStorageService) depend on env varaible.

4- I registered my service provider in config/app.php.

5- then I try to inject the ImageUploderInterface in my controller But I had an error that the interface doesn't exit. image upload interfaceimage upload service providererror appears



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2MYVTpH
via IFTTT

Aucun commentaire:

Enregistrer un commentaire