Browse Source

initial support for supported applications

pull/11/head
KodeStar 7 years ago
parent
commit
daa7079b0c
  1. 3
      app/Http/Controllers/ItemController.php
  2. 15
      app/Item.php
  3. 7
      app/SupportedApps/Contracts/Applications.php
  4. 8
      app/SupportedApps/Nzbget.php
  5. 8
      app/SupportedApps/Plex.php
  6. 5
      resources/views/items/form.blade.php
  7. 4
      vendor/composer/autoload_classmap.php
  8. 4
      vendor/composer/autoload_static.php

3
app/Http/Controllers/ItemController.php

@ -4,6 +4,8 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Item;
//use App\SupportedApps\Contracts\Applications;
use App\SupportedApps\Nzbget;
class ItemController extends Controller
{
@ -18,6 +20,7 @@ class ItemController extends Controller
$data['apps'] = Item::all();
return view('welcome', $data);
}
/**
* Display a listing of the resource.

15
app/Item.php

@ -3,6 +3,9 @@
namespace App;
use Illuminate\Database\Eloquent\Model;
use Symfony\Component\ClassLoader\ClassMapGenerator;
class Item extends Model
{
@ -10,4 +13,16 @@ class Item extends Model
protected $fillable = [
'title', 'url', 'colour', 'icon', 'description', 'pinned'
];
public static function supportedList()
{
return [
'NZBGet' => App\SupportedApps\Nzbget::class,
'Plex' => App\SupportedApps\Plex::class,
];
}
public static function supportedOptions()
{
return array_keys(self::supportedList());
}
}

7
app/SupportedApps/Contracts/Applications.php

@ -0,0 +1,7 @@
<?php namespace App\SupportedApps\Contracts;
interface Applications {
public function defaultColour();
}

8
app/SupportedApps/Nzbget.php

@ -0,0 +1,8 @@
<?php namespace App\SupportedApps;
class Nzbget implements Contracts\Applications {
public function defaultColour()
{
return '#ccc';
}
}

8
app/SupportedApps/Plex.php

@ -0,0 +1,8 @@
<?php namespace App\SupportedApps;
class Plex implements Contracts\Applications {
public function defaultColour()
{
return '#ccc';
}
}

5
resources/views/items/form.blade.php

@ -8,6 +8,11 @@
</header>
<div class="create">
{!! csrf_field() !!}
<div class="input">
<label>Application name</label>
{!! Form::select('supported', \App\Item::supportedOptions(), array('placeholder' => 'Title','class' => 'form-control')) !!}
</div>
<div class="input">
<label>Application name</label>
{!! Form::text('title', null, array('placeholder' => 'Title','class' => 'form-control')) !!}

4
vendor/composer/autoload_classmap.php

@ -26,6 +26,10 @@ return array(
'App\\Providers\\BroadcastServiceProvider' => $baseDir . '/app/Providers/BroadcastServiceProvider.php',
'App\\Providers\\EventServiceProvider' => $baseDir . '/app/Providers/EventServiceProvider.php',
'App\\Providers\\RouteServiceProvider' => $baseDir . '/app/Providers/RouteServiceProvider.php',
'App\\Providers\\SupportedServiceProvider' => $baseDir . '/app/Providers/SupportedServiceProvider.php',
'App\\SupportedApps\\Contracts\\Applications' => $baseDir . '/app/SupportedApps/Contracts/Applications.php',
'App\\SupportedApps\\Nzbget' => $baseDir . '/app/SupportedApps/Nzbget.php',
'App\\SupportedApps\\Plex' => $baseDir . '/app/SupportedApps/Plex.php',
'App\\User' => $baseDir . '/app/User.php',
'ArithmeticError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php',
'AssertionError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/AssertionError.php',

4
vendor/composer/autoload_static.php

@ -337,6 +337,10 @@ class ComposerStaticInit4b6fb9210a1ea37c2db27b8ff53a1ecf
'App\\Providers\\BroadcastServiceProvider' => __DIR__ . '/../..' . '/app/Providers/BroadcastServiceProvider.php',
'App\\Providers\\EventServiceProvider' => __DIR__ . '/../..' . '/app/Providers/EventServiceProvider.php',
'App\\Providers\\RouteServiceProvider' => __DIR__ . '/../..' . '/app/Providers/RouteServiceProvider.php',
'App\\Providers\\SupportedServiceProvider' => __DIR__ . '/../..' . '/app/Providers/SupportedServiceProvider.php',
'App\\SupportedApps\\Contracts\\Applications' => __DIR__ . '/../..' . '/app/SupportedApps/Contracts/Applications.php',
'App\\SupportedApps\\Nzbget' => __DIR__ . '/../..' . '/app/SupportedApps/Nzbget.php',
'App\\SupportedApps\\Plex' => __DIR__ . '/../..' . '/app/SupportedApps/Plex.php',
'App\\User' => __DIR__ . '/../..' . '/app/User.php',
'ArithmeticError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php',
'AssertionError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/AssertionError.php',

Loading…
Cancel
Save