also looking at this
Storage extend
#13
7 files
+19
-7
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -2,8 +2,11 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace Meema\LaravelMeema\Providers; |
| 4 | 4 | |
| 5 | use Illuminate\Support\Facades\Storage; | |
| 5 | 6 | use Illuminate\Support\ServiceProvider; |
| 6 | use Meema\MeemaApi\Client; | |
| 7 | use Meema\Flysystem\MeemaAdapter; | |
| 8 | use Meema\MeemaApi\Client as MeemaClient; | |
| 9 | use League\Flysystem\Filesystem; | |
| 7 | 10 | |
| 8 | 11 | class MeemaServiceProvider extends ServiceProvider |
| 9 | 12 | { |
| @@ -17,6 +20,14 @@ class MeemaServiceProvider extends ServiceProvider | ||
| 17 | 20 | __DIR__.'/../../config/config.php' => config_path('meema.php'), |
| 18 | 21 | ], 'config'); |
| 19 | 22 | } |
| 23 | ||
| 24 | Storage::extend('meema', function ($app, $config) { | |
| 25 | $client = new MeemaClient( | |
| 26 | $config['meema_api_key'] | |
| 27 | ); | |
| 28 | ||
| 29 | return new Filesystem(new MeemaAdapter($client)); | |
| 30 | }); | |
| 20 | 31 | } |
| 21 | 32 | |
| 22 | 33 | /** |