Small changes
Copy icon if missing on new app add. Change order of create symlink and load apps
This commit is contained in:
parent
98c6093674
commit
ab83c3a551
|
@ -13,6 +13,14 @@ class Application extends Model
|
||||||
//
|
//
|
||||||
public function icon()
|
public function icon()
|
||||||
{
|
{
|
||||||
|
if(!file_exists(storage_path('app/public/'.$this->icon))) {
|
||||||
|
$img_src = app_path('SupportedApps/'.$this->name.'/'.str_replace('icons/', '', $this->icon));
|
||||||
|
$img_dest = storage_path('app/public/'.$this->icon);
|
||||||
|
//die("i: ".$img_src);
|
||||||
|
@copy($img_src, $img_dest);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return $this->icon;
|
return $this->icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,11 @@ class AppServiceProvider extends ServiceProvider
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!is_file(public_path('storage'))) {
|
||||||
|
Artisan::call('storage:link');
|
||||||
|
\Session::put('current_user', null);
|
||||||
|
}
|
||||||
|
|
||||||
$applications = Application::all();
|
$applications = Application::all();
|
||||||
if($applications->count() <= 0) {
|
if($applications->count() <= 0) {
|
||||||
if (class_exists('ZipArchive')) {
|
if (class_exists('ZipArchive')) {
|
||||||
|
@ -58,11 +63,6 @@ class AppServiceProvider extends ServiceProvider
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_file(public_path('storage'))) {
|
|
||||||
Artisan::call('storage:link');
|
|
||||||
\Session::put('current_user', null);
|
|
||||||
}
|
|
||||||
|
|
||||||
// User specific settings need to go here as session isn't available at this point in the app
|
// User specific settings need to go here as session isn't available at this point in the app
|
||||||
view()->composer('*', function ($view)
|
view()->composer('*', function ($view)
|
||||||
{
|
{
|
||||||
|
|
|
@ -143,8 +143,8 @@ abstract class SupportedApps
|
||||||
|
|
||||||
public static function saveApp($details, $app)
|
public static function saveApp($details, $app)
|
||||||
{
|
{
|
||||||
if(!file_exists(public_path('storage/icons'))) {
|
if(!file_exists(storage_path('app/public/icons'))) {
|
||||||
mkdir(public_path('storage/icons'), 0777, true);
|
mkdir(storage_path('app/public/icons'), 0777, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$img_src = app_path('SupportedApps/'.className($details->name).'/'.$details->icon);
|
$img_src = app_path('SupportedApps/'.className($details->name).'/'.$details->icon);
|
||||||
|
|
4
public/mix-manifest.json
generated
4
public/mix-manifest.json
generated
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"/css/app.css": "/css/app.css?id=476a34b0b53427a036fd",
|
"/js/app.js": "/js/app.js?id=8dc4a6ea723d0df7469d",
|
||||||
"/js/app.js": "/js/app.js?id=8dc4a6ea723d0df7469d"
|
"/css/app.css": "/css/app.css?id=476a34b0b53427a036fd"
|
||||||
}
|
}
|
Loading…
Reference in a new issue