ReviewOS

also looking at this

meemalabs/laravel-meema

Implement Adapater and Additional Facade

#14
Merged glennmichael123 wants to merge implement-adapter into main
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.

src/Facades/Image.phpadded+50-0
Changes to src/Facades/Image.php
@@ -0,0 +1,50 @@
1<?php
2
3namespace Meema\LaravelMeema\Facades;
4
5use 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 */
39class 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}
src/Facades/Media.phpmodified+2-2
Changes to src/Facades/Media.php
@@ -18,8 +18,8 @@ use Illuminate\Support\Facades\Facade;
1818 * @method static function makePrivate($ids)
1919 * @method static function makePublic($ids)
2020 * @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)
2323 * @method static function getId()
2424 *
2525 * @see \Meema\MeemaClient\Models\Media
src/Facades/Video.phpadded+29-0
Changes to src/Facades/Video.php
@@ -0,0 +1,29 @@
1<?php
2
3namespace Meema\LaravelMeema\Facades;
4
5use 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 */
18class 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}
src/Providers/MeemaServiceProvider.phpmodified+20-2
Changes to src/Providers/MeemaServiceProvider.php
@@ -23,7 +23,7 @@ class MeemaServiceProvider extends ServiceProvider
2323
2424 Storage::extend('meema', function ($app, $config) {
2525 $client = new MeemaClient(
26 $config['meema_api_key']
26 $config['meema.secret_api_key']
2727 );
2828
2929 return new Filesystem(new MeemaAdapter($client));
@@ -37,6 +37,18 @@ class MeemaServiceProvider extends ServiceProvider
3737 {
3838 $this->registerMeemaClient();
3939
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 {
4052 $this->app->bind('meema-media', function ($app) {
4153 return $app['meema']->media();
4254 });
@@ -53,7 +65,13 @@ class MeemaServiceProvider extends ServiceProvider
5365 return $app['meema']->favorites();
5466 });
5567
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 });
5775 }
5876
5977 /**