From 197ae7d12580b8a288378755dc01f5116662af24 Mon Sep 17 00:00:00 2001 From: Felipe Mateus Date: Sun, 17 Oct 2021 13:30:18 -0300 Subject: [PATCH] restructure resources --- README.md | 57 ++++--------------- composer.json | 6 +- src/IPTVProvider.php | 8 ++- src/resources/menu.json | 16 ++++++ src/resources/translations/br.json | 18 ++++++ src/{ => resources}/translations/en.json | 0 src/{ => resources}/views/customer.blade.php | 11 ++-- .../views/customer_list.blade.php | 13 +++-- src/{ => resources}/views/plan.blade.php | 11 ++-- src/{ => resources}/views/plan_list.blade.php | 15 ++--- src/translations/br.json | 13 ----- 11 files changed, 83 insertions(+), 85 deletions(-) create mode 100644 src/resources/menu.json create mode 100644 src/resources/translations/br.json rename src/{ => resources}/translations/en.json (100%) rename src/{ => resources}/views/customer.blade.php (88%) rename src/{ => resources}/views/customer_list.blade.php (65%) rename src/{ => resources}/views/plan.blade.php (94%) rename src/{ => resources}/views/plan_list.blade.php (61%) delete mode 100644 src/translations/br.json diff --git a/README.md b/README.md index 6fafba1..dbb5d73 100644 --- a/README.md +++ b/README.md @@ -1,75 +1,42 @@ # Laravel IPTV Customers - FelipeMateus\IPTVCustomers - -[![Latest Stable Version](http://poser.pugx.org/felipemateus/iptv-customers/v)](https://packagist.org/packages/felipemateus/iptv-customers) [![Total Downloads](http://poser.pugx.org/felipemateus/iptv-customers/downloads)](https://packagist.org/packages/felipemateus/iptv-customers) [![Latest Unstable Version](http://poser.pugx.org/felipemateus/iptv-customers/v/unstable)](https://packagist.org/packages/felipemateus/iptv-customers) [![License](http://poser.pugx.org/felipemateus/iptv-customers/license)](https://packagist.org/packages/felipemateus/iptv-customers) [![PHP Version Require](http://poser.pugx.org/felipemateus/iptv-customers/require/php)](https://packagist.org/packages/felipemateus/iptv-customers) - - -This package controls all customers and plans integrated with [iptv-channels](https://github.com/eufelipemateus/laravel-iptv-channels) generates a list of channels for each customer. - -## Instaling +[![Latest Stable Version](http://poser.pugx.org/felipemateus/iptv-customers/v)](https://packagist.org/packages/felipemateus/iptv-customers) [![Total Downloads](http://poser.pugx.org/felipemateus/iptv-customers/downloads)](https://packagist.org/packages/felipemateus/iptv-customers) [![Latest Unstable Version](http://poser.pugx.org/felipemateus/iptv-customers/v/unstable)](https://packagist.org/packages/felipemateus/iptv-customers) [![License](http://poser.pugx.org/felipemateus/iptv-customers/license)](https://packagist.org/packages/felipemateus/iptv-customers) [![PHP Version Require](http://poser.pugx.org/felipemateus/iptv-customers/require/php)](https://packagist.org/packages/felipemateus/iptv-customers) - +This a Laravel package controls all customers and plans integrated with [iptv-channels](https://github.com/eufelipemateus/laravel-iptv-channels) generates a list of channels m3u8 for each customer. -Tested in Laravel 8.54. +![Screenshot Feipe Mateus IPTV Customers](https://felipemateus.com/wp-content/uploads/2021/10/image_2021-10-15_00-34-26.png) - +## Instaling -### Run the command below in root to install the package in your project. +Tested in Laravel 8.54. - +### Run the command below in root to install the package in your project. ```bash -composer require felipemateus/iptv-customers -``` - - - - -### Verify this file 'config/app.php' - -```php - - [ - -... - -FelipeMateus\IPTVCustomers\IPTVProvider::class -... - -]; +composer require felipemateus/iptv-customers ``` - - ### Migrate the database - - - ```bash - php artisan migrate ``` - +## Extra -## License +- [more info about iptv-customers](https://felipemateus.com/blog/2021/10/gerenciador-iptv-customer) - +- To add new locale compatibility you need contribute to [iptv-core](https://github.com/eufelipemateus/laravel-iptv-core/blob/main/src/Class/Locale.php) first. -[![License](http://poser.pugx.org/felipemateus/iptv-customers/license)](https://packagist.org/packages/felipemateus/iptv-customers) +## License - +[![License](http://poser.pugx.org/felipemateus/iptv-customers/license)](https://packagist.org/packages/felipemateus/iptv-customers) ## Author - [Felipe Mateus](https://felipemateus.com) diff --git a/composer.json b/composer.json index f690ba9..16f3ec3 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "felipemateus/iptv-customers", - "version": "0.0.2", + "version": "0.1.0", "description": "This package controls the IPTV Customers list and generates an m3u8 file for each customer using laravel.", "type": "library", "license": "MIT", @@ -36,8 +36,8 @@ "require": { "php": "^7.4|^8.0", "laravel/framework": "^8.54", - "felipemateus/iptv-core":"^0.0.1", - "felipemateus/iptv-channels": "2.1.0" + "felipemateus/iptv-core":"^1.0.0", + "felipemateus/iptv-channels": "3.0.0" }, "autoload": { "psr-4": { diff --git a/src/IPTVProvider.php b/src/IPTVProvider.php index dde80de..c3f718d 100644 --- a/src/IPTVProvider.php +++ b/src/IPTVProvider.php @@ -5,9 +5,10 @@ use Illuminate\Routing\Router; use Illuminate\Support\ServiceProvider; use FelipeMateus\IPTVCustomers\Middleware\CustomerMiddleware; +use FelipeMateus\IPTVCore\Class\IPTVProviderBase; -class IPTVProvider extends ServiceProvider +class IPTVProvider extends IPTVProviderBase { @@ -20,9 +21,10 @@ public function boot() { $this->registerMidleware(); $this->loadMigrationsFrom(__DIR__.'/database/migrations/'); - $this->loadViewsFrom(__DIR__.'/views', 'IPTV'); + $this->loadViewsFrom(__DIR__.'/resources/views', 'IPTV'); $this->loadRoutesFrom(__DIR__.'/routes.php'); - $this->loadJSONTranslationsFrom(__DIR__.'/translations'); + $this->loadJSONTranslationsFrom(__DIR__.'/resources/translations'); + $this->loadMenusFrom(__DIR__.'/resources/menu'); } diff --git a/src/resources/menu.json b/src/resources/menu.json new file mode 100644 index 0000000..5a92a9f --- /dev/null +++ b/src/resources/menu.json @@ -0,0 +1,16 @@ +{ + "title":"Customers", + "menus":[ + { + "name":"Customers", + "icon": "users", + "route": "list_customer" + }, + { + "name":"Plans", + "icon": "file-contract", + "route": "list_plan" + } + ] +} + diff --git a/src/resources/translations/br.json b/src/resources/translations/br.json new file mode 100644 index 0000000..cfda2fc --- /dev/null +++ b/src/resources/translations/br.json @@ -0,0 +1,18 @@ +{ + "Customers": "Clientes", + "Add Customer": "Add Cliente", + "Customers List": "Lista de Clientes", + "Customer":"Cliente", + "Plans": "Planos", + + "Username":"Usuário", + "Plan": "Plano", + "Plans List":"Lista de Planos", + "Add Plan": "Adicionar Plano", + "Price": "Preço", + "Plan Active?": "Plano Ativo?", + "Is additional?": "Plano adicional?", + "Channels Groups" : "Grupos de Canais", + "add group": "adicionar grupo", + "delete group": "excluir grupo" +} diff --git a/src/translations/en.json b/src/resources/translations/en.json similarity index 100% rename from src/translations/en.json rename to src/resources/translations/en.json diff --git a/src/views/customer.blade.php b/src/resources/views/customer.blade.php similarity index 88% rename from src/views/customer.blade.php rename to src/resources/views/customer.blade.php index bc0f066..5b56741 100644 --- a/src/views/customer.blade.php +++ b/src/resources/views/customer.blade.php @@ -1,16 +1,17 @@ @extends('IPTV::app') @section('content') + +
+

{{ __('Customers') }}

+
-
+
-
{{ __('Customers') }}
- - - +
{{ __('Customer') }}
diff --git a/src/views/customer_list.blade.php b/src/resources/views/customer_list.blade.php similarity index 65% rename from src/views/customer_list.blade.php rename to src/resources/views/customer_list.blade.php index 4eae5d7..293d994 100644 --- a/src/views/customer_list.blade.php +++ b/src/resources/views/customer_list.blade.php @@ -1,16 +1,19 @@ @extends('IPTV::app') @section('content') + +
+

{{ __('Customers') }}

+ {{ __('Add Customer') }} +
-
+
-
{{ __('Customers') }}
- - - +
{{ __('Customers List') }}
diff --git a/src/views/plan.blade.php b/src/resources/views/plan.blade.php similarity index 94% rename from src/views/plan.blade.php rename to src/resources/views/plan.blade.php index ae79157..1f9f1b2 100644 --- a/src/views/plan.blade.php +++ b/src/resources/views/plan.blade.php @@ -16,15 +16,18 @@ @endsection @section('content') + +
+

{{ __('Plans') }}

+
+
-
+
@@ -77,7 +80,7 @@ @if(isset($Plan))
-
+
diff --git a/src/views/plan_list.blade.php b/src/resources/views/plan_list.blade.php similarity index 61% rename from src/views/plan_list.blade.php rename to src/resources/views/plan_list.blade.php index d04b43f..41d6aa1 100644 --- a/src/views/plan_list.blade.php +++ b/src/resources/views/plan_list.blade.php @@ -1,18 +1,19 @@ @extends('IPTV::app') @section('content') + +
+

{{ __('Plans') }}

+ {{ __('Add Plan') }} +
-
+
-
{{ __('Customers Plan') }}
- - - - - +
{{ __('Plans List') }}
diff --git a/src/translations/br.json b/src/translations/br.json deleted file mode 100644 index 1a35c1e..0000000 --- a/src/translations/br.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "Customers": "Clientes", - "Add Customer": "Add Cliente", - - "Username":"Usuário", - "Plan": "Plano", - "Plan List":"Lista de Planos", - "Add Plan": "Adicionar Plano", - "Price": "Price", - "Plan Active?": "Plano Ativo?", - "Is additional?": "Plano adicional?", - "Channels Groups" : "Grupos de Canais" -}