You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

31 lines
699 B

<?php
namespace App;
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;
}
}