├── dist ├── css │ └── tool.css └── js │ └── tool.js ├── resources ├── sass │ └── tool.scss ├── js │ ├── tool.js │ └── components │ │ └── Tool.vue └── views │ └── navigation.blade.php ├── screenshot.png ├── mix-manifest.json ├── webpack.mix.js ├── .gitignore ├── src ├── Http │ ├── Middleware │ │ └── Authorize.php │ └── Controllers │ │ └── MollieController.php ├── NovaMollieTool.php └── ToolServiceProvider.php ├── routes └── api.php ├── composer.json ├── README.md └── package.json /dist/css/tool.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/sass/tool.scss: -------------------------------------------------------------------------------- 1 | // Nova Tool CSS 2 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Taronyuu/nova-mollie-tool/HEAD/screenshot.png -------------------------------------------------------------------------------- /mix-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "/dist/js/tool.js": "/dist/js/tool.js", 3 | "/dist/css/tool.css": "/dist/css/tool.css" 4 | } -------------------------------------------------------------------------------- /webpack.mix.js: -------------------------------------------------------------------------------- 1 | let mix = require('laravel-mix') 2 | 3 | mix.js('resources/js/tool.js', 'dist/js') 4 | .sass('resources/sass/tool.scss', 'dist/css') 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /vendor 3 | /node_modules 4 | package-lock.json 5 | composer.phar 6 | composer.lock 7 | phpunit.xml 8 | .phpunit.result.cache 9 | .DS_Store 10 | Thumbs.db 11 | -------------------------------------------------------------------------------- /resources/js/tool.js: -------------------------------------------------------------------------------- 1 | Nova.booting((Vue, router) => { 2 | Vue.config.devtools = true; 3 | router.addRoutes([ 4 | { 5 | name: 'nova-mollie-tool', 6 | path: '/nova-mollie-tool', 7 | component: require('./components/Tool'), 8 | }, 9 | ]) 10 | }) 11 | -------------------------------------------------------------------------------- /src/Http/Middleware/Authorize.php: -------------------------------------------------------------------------------- 1 | authorize($request) ? $next($request) : abort(403); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | =7.1.0", 11 | "mollie/mollie-api-php": "^2.0" 12 | }, 13 | "autoload": { 14 | "psr-4": { 15 | "Taronyuu\\NovaMollieTool\\": "src/" 16 | } 17 | }, 18 | "extra": { 19 | "laravel": { 20 | "providers": [ 21 | "Taronyuu\\NovaMollieTool\\ToolServiceProvider" 22 | ] 23 | } 24 | }, 25 | "config": { 26 | "sort-packages": true 27 | }, 28 | "minimum-stability": "dev", 29 | "prefer-stable": true 30 | } 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Laravel Nova Mollie Tool 2 | > Simple package to get transactions from Mollie in your Nova dashboard. 3 | 4 | ![Nova Mollie Transactions](https://raw.githubusercontent.com/Taronyuu/nova-mollie-tool/master/screenshot.png) 5 | 6 | ## Installation 7 | 8 | Start with installing the package 9 | 10 | `composer require taronyuu/nova-mollie-tool` 11 | 12 | Then register the tool inside the `NovaServiceProvider.php` 13 | 14 | ```php 15 | public function tools() 16 | { 17 | return [new NovaMollieTool]; 18 | } 19 | ``` 20 | 21 | Add these fields to `config/services.php` to make sure Mollie will work. 22 | ```php 23 | 'nova_mollie_tool' => [ 24 | 'title' => 'Mollie ', 25 | 'icon' => null, 26 | 'api_key' => env('MOLLIE_KEY'), 27 | 'request' => [ 28 | 'limit' => 20, 29 | ] 30 | ], 31 | ``` 32 | -------------------------------------------------------------------------------- /src/NovaMollieTool.php: -------------------------------------------------------------------------------- 1 | 2 | {!! config('services.nova_mollie_tool.icon', '') !!} 3 | 4 | {{ config('services.nova_mollie_tool.title', 'Mollie transactions') }} 5 | 6 | 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 6 | "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 7 | "watch-poll": "npm run watch -- --watch-poll", 8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", 9 | "prod": "npm run production", 10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 11 | }, 12 | "devDependencies": { 13 | "cross-env": "^5.0.0", 14 | "laravel-mix": "^1.0" 15 | }, 16 | "dependencies": { 17 | "vue": "^2.5.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/ToolServiceProvider.php: -------------------------------------------------------------------------------- 1 | loadViewsFrom(__DIR__.'/../resources/views', 'nova-mollie-tool'); 21 | 22 | $this->app->booted(function () { 23 | $this->routes(); 24 | }); 25 | 26 | Nova::serving(function (ServingNova $event) { 27 | Nova::provideToScript([ 28 | 'tool_title' => config('services.nova_mollie_tool.title') 29 | ]); 30 | }); 31 | 32 | } 33 | 34 | /** 35 | * Register the tool's routes. 36 | * 37 | * @return void 38 | */ 39 | protected function routes() 40 | { 41 | if ($this->app->routesAreCached()) { 42 | return; 43 | } 44 | 45 | Route::middleware(['nova', Authorize::class]) 46 | ->prefix('nova-vendor/nova-mollie-tool') 47 | ->group(__DIR__.'/../routes/api.php'); 48 | } 49 | 50 | /** 51 | * Register any application services. 52 | * 53 | * @return void 54 | */ 55 | public function register() 56 | { 57 | // 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Http/Controllers/MollieController.php: -------------------------------------------------------------------------------- 1 | setApiKey(config('services.nova_mollie_tool.api_key')); 23 | 24 | $limit = config('services.nova_mollie_tool.request.limit'); 25 | $next = $request->get('url'); 26 | $from = null; 27 | if($next) { 28 | $url = parse_url($next); 29 | $query = $url['query']; 30 | $list = explode('&', $query); 31 | foreach ($list as $value) { 32 | [$key, $value] = explode('=', $value); 33 | if($key === 'from') { 34 | $from = $value; 35 | break; 36 | } 37 | } 38 | } 39 | 40 | $payments = $mollie->payments->page( $from, $limit ); 41 | 42 | return response() 43 | ->json([ 44 | 'payments' => $payments, 45 | 'next' => $payments->_links->next->href ?? null, 46 | 'prev' => $payments->_links->previous->href ?? null, 47 | ]); 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /resources/js/components/Tool.vue: -------------------------------------------------------------------------------- 1 | 100 | 101 | 178 | 179 | 182 | -------------------------------------------------------------------------------- /dist/js/tool.js: -------------------------------------------------------------------------------- 1 | !function(t){var e={};function n(s){if(e[s])return e[s].exports;var r=e[s]={i:s,l:!1,exports:{}};return t[s].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,s){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:s})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){n(1),t.exports=n(11)},function(t,e,n){Nova.booting(function(t,e){t.config.devtools=!0,e.addRoutes([{name:"nova-mollie-tool",path:"/nova-mollie-tool",component:n(2)}])})},function(t,e,n){var s=n(8)(n(9),n(10),!1,function(t){n(3)},null,null);t.exports=s.exports},function(t,e,n){var s=n(4);"string"==typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);n(6)("41742730",s,!0,{})},function(t,e,n){(t.exports=n(5)(!1)).push([t.i,"",""])},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",s=t[3];if(!s)return n;if(e&&"function"==typeof btoa){var r=(o=s,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),a=s.sources.map(function(t){return"/*# sourceURL="+s.sourceRoot+t+" */"});return[n].concat(a).concat([r]).join("\n")}var o;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var s={},r=0;rn.parts.length&&(s.parts.length=n.parts.length)}else{var o=[];for(r=0;r