diff --git a/src/App.php b/src/App.php index f7fa1c3a..8c06ad1c 100644 --- a/src/App.php +++ b/src/App.php @@ -87,4 +87,14 @@ public function openAtLogin(?bool $open = null): bool return $open; } + + public function isEmojiPanelSupported(): bool + { + return (bool) $this->client->get('app/is-emoji-panel-supported')->json('supported'); + } + + public function showEmojiPanel(): void + { + $this->client->post('app/show-emoji-panel'); + } } diff --git a/src/Commands/SeedDatabaseCommand.php b/src/Commands/SeedDatabaseCommand.php index 68b225a6..cd56a20d 100644 --- a/src/Commands/SeedDatabaseCommand.php +++ b/src/Commands/SeedDatabaseCommand.php @@ -12,6 +12,8 @@ )] class SeedDatabaseCommand extends BaseSeedCommand { + protected $signature = 'native:seed'; + public function handle() { (new NativeServiceProvider($this->laravel))->rewriteDatabase(); diff --git a/src/Commands/WipeDatabaseCommand.php b/src/Commands/WipeDatabaseCommand.php new file mode 100644 index 00000000..6114bd42 --- /dev/null +++ b/src/Commands/WipeDatabaseCommand.php @@ -0,0 +1,20 @@ +laravel))->rewriteDatabase(); + + return parent::handle(); + } +} diff --git a/src/Facades/App.php b/src/Facades/App.php index 14e42f87..8754580e 100644 --- a/src/Facades/App.php +++ b/src/Facades/App.php @@ -17,6 +17,8 @@ * @method static void clearRecentDocuments() * @method static bool isRunningBundled() * @method static bool openAtLogin(?bool $open = null) + * @method static bool isEmojiPanelSupported() + * @method static void showEmojiPanel() */ class App extends Facade { diff --git a/src/Logging/LogWatcher.php b/src/Logging/LogWatcher.php index e48eaf43..2937848c 100644 --- a/src/Logging/LogWatcher.php +++ b/src/Logging/LogWatcher.php @@ -19,7 +19,11 @@ public function register(): void 'context' => $message->context, ]; - $this->client->post('debug/log', $payload); + try { + $this->client->post('debug/log', $payload); + } catch (\Throwable $e) { + // The server might not be running, or the connection could fail, hiding the error. + } }); } } diff --git a/src/NativeServiceProvider.php b/src/NativeServiceProvider.php index 74dfba3c..46e7dcb0 100644 --- a/src/NativeServiceProvider.php +++ b/src/NativeServiceProvider.php @@ -15,6 +15,7 @@ use Native\Laravel\Commands\LoadStartupConfigurationCommand; use Native\Laravel\Commands\MigrateCommand; use Native\Laravel\Commands\SeedDatabaseCommand; +use Native\Laravel\Commands\WipeDatabaseCommand; use Native\Laravel\Contracts\ChildProcess as ChildProcessContract; use Native\Laravel\Contracts\GlobalShortcut as GlobalShortcutContract; use Native\Laravel\Contracts\PowerMonitor as PowerMonitorContract; @@ -42,6 +43,7 @@ public function configurePackage(Package $package): void FreshCommand::class, MigrateCommand::class, SeedDatabaseCommand::class, + WipeDatabaseCommand::class, ]) ->hasConfigFile() ->hasRoute('api')