Heimdall/app/Application.php

46 lines
850 B
PHP
Raw Normal View History

2018-10-18 14:59:38 +00:00
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Application extends Model
{
//
2018-10-19 14:10:05 +00:00
public function icon()
{
2018-10-21 11:39:12 +00:00
return $this->icon;
}
public function iconView()
{
return asset('storage/'.$this->icon);
2018-10-19 14:10:05 +00:00
}
public function defaultColour()
{
// check if light or dark
if($this->tile_background == 'light') return '#fafbfc';
return '#161b1f';
}
public function class()
{
2018-10-20 23:17:36 +00:00
$class = '\App\SupportedApps\\'.$this->name.'\\'.$this->name;
2018-10-19 14:10:05 +00:00
return $class;
}
2018-10-21 11:39:12 +00:00
2018-10-23 14:53:56 +00:00
public static function applist()
{
$list = [];
$all = self::all();
$list['null'] = 'None';
foreach($all as $app) {
$list['\App\SupportedApps\\'.$app->name.'\\'.$app->name] = $app->name;
}
return $list;
}
2018-10-21 11:39:12 +00:00
2018-10-18 14:59:38 +00:00
}