mirror of
https://github.com/linuxserver/Heimdall.git
synced 2026-02-21 20:20:34 +09:00
work on applications
This commit is contained in:
@@ -7,4 +7,25 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Application extends Model
|
||||
{
|
||||
//
|
||||
public function icon()
|
||||
{
|
||||
$path = public_path('storage/apps/'.$this->icon);
|
||||
if(!file_exists($path)) {
|
||||
Storage::putFileAs('apps', new File(app_path('Apps/'.$this->name.'/'.$this->icon)), $this->icon);
|
||||
}
|
||||
return asset('storage/apps/'.$this->icon);
|
||||
}
|
||||
|
||||
public function defaultColour()
|
||||
{
|
||||
// check if light or dark
|
||||
if($this->tile_background == 'light') return '#fafbfc';
|
||||
return '#161b1f';
|
||||
}
|
||||
|
||||
public function class()
|
||||
{
|
||||
$class = '\App\SupportedApps\\'.$this->name;
|
||||
return $class;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user