Skip to content

Commit 1208a6d

Browse files
install command
1 parent e706d8e commit 1208a6d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ You can install the package via composer:
3333
composer require thethunderturner/filament-latex
3434
```
3535

36-
You can publish and run the migrations with:
36+
With the install command, the package will automatically publish the migrations and the config file.
37+
```bash
38+
php artisan filament-latex:install
39+
```
40+
41+
Optionally, you can publish them individually:
3742

3843
```bash
3944
php artisan vendor:publish --tag="filament-latex-migrations"

src/FilamentLatexServiceProvider.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Filament\Support\Assets\AlpineComponent;
66
use Filament\Support\Facades\FilamentAsset;
7+
use Spatie\LaravelPackageTools\Commands\InstallCommand;
78
use Spatie\LaravelPackageTools\Package;
89
use Spatie\LaravelPackageTools\PackageServiceProvider;
910

@@ -18,7 +19,13 @@ public function configurePackage(Package $package): void
1819
->hasConfigFile()
1920
->hasRoute('web')
2021
->hasMigrations($this->getMigrations())
21-
->hasTranslations();
22+
->hasTranslations()
23+
->hasInstallCommand(function (InstallCommand $command) {
24+
$command
25+
->publishConfigFile()
26+
->publishMigrations()
27+
->askToRunMigrations();
28+
});
2229
}
2330

2431
public function packageBooted(): void

0 commit comments

Comments
 (0)