also looking at this
Implement Adapater and Additional Facade
#14
4 files
+101
-4
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.
| @@ -0,0 +1,50 @@ | ||
| 1 | <?php | |
| 2 | ||
| 3 | namespace Meema\LaravelMeema\Facades; | |
| 4 | ||
| 5 | use Illuminate\Support\Facades\Facade; | |
| 6 | ||
| 7 | /** | |
| 8 | * @method static function w($value) | |
| 9 | * @method static function h($value) | |
| 10 | * @method static function q($value) | |
| 11 | * @method static function blur($value) | |
| 12 | * @method static function nsfw($value) | |
| 13 | * @method static function bg($value) | |
| 14 | * @method static function ar($value) | |
| 15 | * @method static function br($value) | |
| 16 | * @method static function hue($value) | |
| 17 | * @method static function sat($value) | |
| 18 | * @method static function sharp($value) | |
| 19 | * @method static function pad($value) | |
| 20 | * @method static function greyscale($value) | |
| 21 | * @method static function trim($value) | |
| 22 | * @method static function faceindex($value) | |
| 23 | * @method static function fillColor($value) | |
| 24 | * @method static function fill($value) | |
| 25 | * @method static function cs($value) | |
| 26 | * @method static function dpr($value) | |
| 27 | * @method static function extend($value) | |
| 28 | * @method static function extract($value) | |
| 29 | * @method static function crop($value) | |
| 30 | * @method static function maxH($value) | |
| 31 | * @method static function minH($value) | |
| 32 | * @method static function maxW($value) | |
| 33 | * @method static function minW($value) | |
| 34 | * @method static function fit($value) | |
| 35 | * @method static function px($value) | |
| 36 | * | |
| 37 | * @see \Meema\MeemaClient\Functions\Image | |
| 38 | */ | |
| 39 | class Image extends Facade | |
| 40 | { | |
| 41 | /** | |
| 42 | * Get the registered name of the component. | |
| 43 | * | |
| 44 | * @return string | |
| 45 | */ | |
| 46 | protected static function getFacadeAccessor() | |
| 47 | { | |
| 48 | return 'meema-image'; | |
| 49 | } | |
| 50 | } | |
| @@ -18,8 +18,8 @@ use Illuminate\Support\Facades\Facade; | ||
| 18 | 18 | * @method static function makePrivate($ids) |
| 19 | 19 | * @method static function makePublic($ids) |
| 20 | 20 | * @method static function duplicate($ids) |
| 21 | * @method static folders($id = null) | |
| 22 | * @method static tags($id = null) | |
| 21 | * @method static function folders($id = null) | |
| 22 | * @method static function tags($id = null) | |
| 23 | 23 | * @method static function getId() |
| 24 | 24 | * |
| 25 | 25 | * @see \Meema\MeemaClient\Models\Media |
| @@ -0,0 +1,29 @@ | ||
| 1 | <?php | |
| 2 | ||
| 3 | namespace Meema\LaravelMeema\Facades; | |
| 4 | ||
| 5 | use Illuminate\Support\Facades\Facade; | |
| 6 | ||
| 7 | /** | |
| 8 | * @method static function thumbnails($value) | |
| 9 | * @method static function hls($value) | |
| 10 | * @method static function dash($value) | |
| 11 | * @method static function poster($value) | |
| 12 | * @method static function webvtt($value) | |
| 13 | * @method static function format($value) | |
| 14 | * @method static function webOptimized($value) | |
| 15 | * | |
| 16 | * @see \Meema\MeemaClient\Functions\Video | |
| 17 | */ | |
| 18 | class Video extends Facade | |
| 19 | { | |
| 20 | /** | |
| 21 | * Get the registered name of the component. | |
| 22 | * | |
| 23 | * @return string | |
| 24 | */ | |
| 25 | protected static function getFacadeAccessor() | |
| 26 | { | |
| 27 | return 'meema-video'; | |
| 28 | } | |
| 29 | } | |
| @@ -23,7 +23,7 @@ class MeemaServiceProvider extends ServiceProvider | ||
| 23 | 23 | |
| 24 | 24 | Storage::extend('meema', function ($app, $config) { |
| 25 | 25 | $client = new MeemaClient( |
| 26 | $config['meema_api_key'] | |
| 26 | $config['meema.secret_api_key'] | |
| 27 | 27 | ); |
| 28 | 28 | |
| 29 | 29 | return new Filesystem(new MeemaAdapter($client)); |
| @@ -37,6 +37,18 @@ class MeemaServiceProvider extends ServiceProvider | ||
| 37 | 37 | { |
| 38 | 38 | $this->registerMeemaClient(); |
| 39 | 39 | |
| 40 | $this->bindModels(); | |
| 41 | ||
| 42 | $this->mergeConfigFrom(__DIR__.'/../../config/config.php', 'meema'); | |
| 43 | } | |
| 44 | ||
| 45 | /** | |
| 46 | * Registers the Meema SDK Client Models. | |
| 47 | * | |
| 48 | * @return void | |
| 49 | */ | |
| 50 | public function bindModels() | |
| 51 | { | |
| 40 | 52 | $this->app->bind('meema-media', function ($app) { |
| 41 | 53 | return $app['meema']->media(); |
| 42 | 54 | }); |
| @@ -53,7 +65,13 @@ class MeemaServiceProvider extends ServiceProvider | ||
| 53 | 65 | return $app['meema']->favorites(); |
| 54 | 66 | }); |
| 55 | 67 | |
| 56 | $this->mergeConfigFrom(__DIR__.'/../../config/config.php', 'meema'); | |
| 68 | $this->app->bind('meema-image', function ($app) { | |
| 69 | return $app['meema']->image(); | |
| 70 | }); | |
| 71 | ||
| 72 | $this->app->bind('meema-video', function ($app) { | |
| 73 | return $app['meema']->video(); | |
| 74 | }); | |
| 57 | 75 | } |
| 58 | 76 | |
| 59 | 77 | /** |