Skip to content

Commit 12bc628

Browse files
authored
Merge branch 'NativePHP:main' into patch-1
2 parents 5694798 + c8eb8ac commit 12bc628

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

src/App.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,14 @@ public function openAtLogin(?bool $open = null): bool
8787

8888
return $open;
8989
}
90+
91+
public function isEmojiPanelSupported(): bool
92+
{
93+
return (bool) $this->client->get('app/is-emoji-panel-supported')->json('supported');
94+
}
95+
96+
public function showEmojiPanel(): void
97+
{
98+
$this->client->post('app/show-emoji-panel');
99+
}
90100
}

src/Commands/WipeDatabaseCommand.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace Native\Laravel\Commands;
4+
5+
use Illuminate\Database\Console\WipeCommand as BaseWipeCommand;
6+
use Native\Laravel\NativeServiceProvider;
7+
8+
class WipeDatabaseCommand extends BaseWipeCommand
9+
{
10+
protected $name = 'native:db:wipe';
11+
12+
protected $description = 'Wipe the database in the NativePHP development environment';
13+
14+
public function handle()
15+
{
16+
(new NativeServiceProvider($this->laravel))->rewriteDatabase();
17+
18+
return parent::handle();
19+
}
20+
}

src/Facades/App.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* @method static void clearRecentDocuments()
1818
* @method static bool isRunningBundled()
1919
* @method static bool openAtLogin(?bool $open = null)
20+
* @method static bool isEmojiPanelSupported()
21+
* @method static void showEmojiPanel()
2022
*/
2123
class App extends Facade
2224
{

src/NativeServiceProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Native\Laravel\Commands\LoadStartupConfigurationCommand;
1616
use Native\Laravel\Commands\MigrateCommand;
1717
use Native\Laravel\Commands\SeedDatabaseCommand;
18+
use Native\Laravel\Commands\WipeDatabaseCommand;
1819
use Native\Laravel\Contracts\ChildProcess as ChildProcessContract;
1920
use Native\Laravel\Contracts\GlobalShortcut as GlobalShortcutContract;
2021
use Native\Laravel\Contracts\PowerMonitor as PowerMonitorContract;
@@ -42,6 +43,7 @@ public function configurePackage(Package $package): void
4243
FreshCommand::class,
4344
MigrateCommand::class,
4445
SeedDatabaseCommand::class,
46+
WipeDatabaseCommand::class,
4547
])
4648
->hasConfigFile()
4749
->hasRoute('api')

0 commit comments

Comments
 (0)