ReviewOS

also looking at this

meemalabs/laravel-meema

Initial Progress

#2
Merged glennmichael123 wants to merge initial-progress into main
11 files +235 -34
.github/workflows/run-tests.ymlmodified+1-1
Changes to .github/workflows/run-tests.yml
@@ -1,6 +1,6 @@
11name: run-tests
22
3on: [push, pull_request]
3on: [pull_request]
44
55jobs:
66 test:
.gitignoremodified+1-0
Changes to .gitignore
@@ -5,3 +5,4 @@ vendor
55coverage
66.phpunit.result.cache
77.idea
8.env
composer.jsonmodified+7-5
Changes to composer.json
@@ -20,12 +20,14 @@
2020 }
2121 ],
2222 "require": {
23 "php": "^7.0|^8.0",
23 "php": "^7.2.5 || ^8.0",
2424 "meema/meema-client-php": "dev-main"
2525 },
2626 "require-dev": {
27 "symfony/var-dumper": "^4.3",
28 "phpunit/phpunit": "^8.2"
27 "orchestra/testbench": "^5.0|^6.0",
28 "pestphp/pest": "^1.0",
29 "pestphp/pest-plugin-laravel": "^1.0",
30 "phpunit/phpunit": "^8.0|^9.3"
2931 },
3032 "autoload": {
3133 "psr-4": {
@@ -47,10 +49,10 @@
4749 "extra": {
4850 "laravel": {
4951 "providers": [
50 "Meema\\LaravelMeema\\MeemaServiceProvider"
52 "Meema\\LaravelMeema\\Providers\\MeemaServiceProvider"
5153 ],
5254 "aliases": {
53 "Meema": "Meema\\LaravelMeema\\MeemaFacade"
55 "Meema": "Meema\\LaravelMeema\\Facades\\MeemaFacade"
5456 }
5557 }
5658 }
config/config.phpadded+8-0
Changes to config/config.php
@@ -0,0 +1,8 @@
1<?php
2
3return [
4 /*
5 * The publishable API key provided by the meema API
6 */
7 'api_key' => env('MEEMA_API_KEY', ''),
8];
src/Facades/Favorite.phpadded+27-0
Changes to src/Facades/Favorite.php
@@ -0,0 +1,27 @@
1<?php
2
3namespace Meema\LaravelMeema\Facades;
4
5use Illuminate\Support\Facades\Facade;
6
7/**
8 * @method static function all()
9 * @method static function get($ids = null)
10 * @method static function find($id)
11 * @method static function update($id, $name)
12 * @method static function delete($ids)
13 *
14 * @see \Meema\MeemaApi\Models\Favorite
15 */
16class Favorite extends Facade
17{
18 /**
19 * Get the registered name of the component.
20 *
21 * @return string
22 */
23 protected static function getFacadeAccessor()
24 {
25 return 'meema-favorite';
26 }
27}
src/Facades/Folder.phpadded+36-0
Changes to src/Facades/Folder.php
@@ -0,0 +1,36 @@
1<?php
2
3namespace Meema\LaravelMeema\Facades;
4
5use Illuminate\Support\Facades\Facade;
6
7/**
8 * @method static function all()
9 * @method static function get($ids = null)
10 * @method static function search($query)
11 * @method static function find($id)
12 * @method static function create($name)
13 * @method static function update($id, $name)
14 * @method static function delete($ids)
15 * @method static function archive($ids)
16 * @method static function unarchive($ids)
17 * @method static function makePublic($ids)
18 * @method static function duplicate($ids)
19 * @method static function getId()
20 * @method static media($id = null)
21 * @method static tags($id = null)
22 *
23 * @see \Meema\MeemaApi\Models\Folder
24 */
25class Folder extends Facade
26{
27 /**
28 * Get the registered name of the component.
29 *
30 * @return string
31 */
32 protected static function getFacadeAccessor()
33 {
34 return 'meema-folder';
35 }
36}
src/Facades/Media.phpadded+38-0
Changes to src/Facades/Media.php
@@ -0,0 +1,38 @@
1<?php
2
3namespace Meema\LaravelMeema\Facades;
4
5use Illuminate\Support\Facades\Facade;
6
7/**
8 * @method static function all()
9 * @method static function get($ids = null)
10 * @method static function search($query)
11 * @method static function find($id)
12 * @method static function create($name)
13 * @method static function update($id, $name)
14 * @method static function delete($ids)
15 * @method static function upload($path)
16 * @method static function archive($ids)
17 * @method static function unarchive($ids)
18 * @method static function makePrivate($ids)
19 * @method static function makePublic($ids)
20 * @method static function duplicate($ids)
21 * @method static folders($id = null)
22 * @method static tags($id = null)
23 * @method static function getId()
24 *
25 * @see \Meema\MeemaApi\Models\Media
26 */
27class Media extends Facade
28{
29 /**
30 * Get the registered name of the component.
31 *
32 * @return string
33 */
34 protected static function getFacadeAccessor()
35 {
36 return 'meema-media';
37 }
38}
src/Facades/Meema.phpadded+28-0
Changes to src/Facades/Meema.php
@@ -0,0 +1,28 @@
1<?php
2
3namespace Meema\LaravelMeema\Facades;
4
5use Illuminate\Support\Facades\Facade;
6
7/**
8 * @method static function request($method, $path, $data = null)
9 * @method static function getAccessKey()
10 * @method static function folders()
11 * @method static function media()
12 * @method static function tags()
13 * @method static function favorites()
14 *
15 * @see \Meema\MeemaApi\Client
16 */
17class Meema extends Facade
18{
19 /**
20 * Get the registered name of the component.
21 *
22 * @return string
23 */
24 protected static function getFacadeAccessor()
25 {
26 return 'meema';
27 }
28}
src/Facades/Tag.phpadded+30-0
Changes to src/Facades/Tag.php
@@ -0,0 +1,30 @@
1<?php
2
3namespace Meema\LaravelMeema\Facades;
4
5use Illuminate\Support\Facades\Facade;
6
7/**
8 * @method static function all()
9 * @method static function get($ids = null)
10 * @method static function find($id)
11 * @method static function update($id, $name)
12 * @method static function delete($ids)
13 * @method static media($id = null)
14 * @method static folders($id = null)
15 * @method static function getId()
16 *
17 * @see \Meema\MeemaApi\Models\Tag
18 */
19class Tag extends Facade
20{
21 /**
22 * Get the registered name of the component.
23 *
24 * @return string
25 */
26 protected static function getFacadeAccessor()
27 {
28 return 'meema-tag';
29 }
30}
src/MeemaServiceProvider.phpdeleted+0-28
Changes to src/MeemaServiceProvider.php
@@ -1,28 +0,0 @@
1<?php
2
3namespace Meema\LaravelMeema;
4
5use Illuminate\Support\ServiceProvider;
6
7class MeemaServiceProvider extends ServiceProvider
8{
9 /**
10 * Bootstrap the application services.
11 */
12 public function boot()
13 {
14 if ($this->app->runningInConsole()) {
15 $this->publishes([
16 __DIR__.'/../config/config.php' => config_path('meema.php'),
17 ], 'config');
18 }
19 }
20
21 /**
22 * Register the application services.
23 */
24 public function register()
25 {
26 $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'meema');
27 }
28}
src/Providers/MeemaServiceProvider.phpadded+59-0
Changes to src/Providers/MeemaServiceProvider.php
@@ -0,0 +1,59 @@
1<?php
2
3namespace Meema\LaravelMeema\Providers;
4
5use Illuminate\Support\ServiceProvider;
6use Meema\MeemaApi\Client;
7
8class MeemaServiceProvider extends ServiceProvider
9{
10 /**
11 * Bootstrap the application services.
12 */
13 public function boot()
14 {
15 if ($this->app->runningInConsole()) {
16 $this->publishes([
17 __DIR__.'/../../config/config.php' => config_path('meema.php'),
18 ], 'config');
19 }
20 }
21
22 /**
23 * Register the application services.
24 */
25 public function register()
26 {
27 $this->registerMeemaClient();
28
29 $this->app->bind('meema-media', function ($app) {
30 return $app['meema']->media();
31 });
32
33 $this->app->bind('meema-folder', function ($app) {
34 return $app['meema']->folders();
35 });
36
37 $this->app->bind('meema-tag', function ($app) {
38 return $app['meema']->tags();
39 });
40
41 $this->app->bind('meema-favorite', function ($app) {
42 return $app['meema']->favorite();
43 });
44
45 $this->mergeConfigFrom(__DIR__.'/../../config/config.php', 'meema');
46 }
47
48 /**
49 * Registers the Meema SDK Client.
50 *
51 * @return void
52 */
53 protected function registerMeemaClient()
54 {
55 $this->app->singleton('meema', function ($app) {
56 return new Client(config('meema.api_key'));
57 });
58 }
59}