Skip to content

Commit

Permalink
🐛 Fix check installed
Browse files Browse the repository at this point in the history
  • Loading branch information
juzaweb committed May 19, 2022
1 parent 5ddf5df commit f9afd78
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/DevTool/Providers/DevToolServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Juzaweb\CMS\Providers\TelescopeServiceProvider;
use Juzaweb\CMS\Support\ServiceProvider;
use Juzaweb\CMS\Support\Stub;
use Laravel\Telescope\TelescopeApplicationServiceProvider;

class DevToolServiceProvider extends ServiceProvider
{
Expand All @@ -31,7 +32,10 @@ public function boot()
$this->app->register(DebugbarServiceProvider::class);
}

if (class_exists(TelescopeServiceProvider::class)) {
if (
class_exists(TelescopeApplicationServiceProvider::class)
&& class_exists(TelescopeServiceProvider::class)
) {
$this->app->register(TelescopeServiceProvider::class);
}
}
Expand Down
20 changes: 20 additions & 0 deletions modules/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,26 @@

require __DIR__ . '/define.php';

if (!file_exists(JW_BASE_PATH . '/.env')) {
copy(JW_BASE_PATH . '/.env.example', JW_BASE_PATH . '/.env');
file_put_contents(
JW_BASE_PATH . '/.env',
str_replace(
[
'APP_KEY='
],
[
'APP_KEY=base64:'.base64_encode(\Illuminate\Support\Str::random(32))
],
file_get_contents(JW_BASE_PATH . '/.env')
)
);

if (file_exists(JW_BASE_PATH . '/storage/app/installed')) {
unlink(JW_BASE_PATH . '/storage/app/installed');
}
}

if (JW_PLUGIN_AUTOLOAD) {
$autoloadPsr4 = __DIR__ . '/../bootstrap/cache/plugin_autoload_psr4.php';
if (file_exists($autoloadPsr4)) {
Expand Down

0 comments on commit f9afd78

Please sign in to comment.