Skip to content

Commit b4205c5

Browse files
committed
fixes
1 parent 24a42f2 commit b4205c5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Filament/Pages/Importer.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Illuminate\Support\Facades\Schema;
1111
use Illuminate\Support\Str;
1212
use LaraZeus\Rhea\RheaPlugin;
13+
use LaraZeus\Sky\SkyPlugin;
1314

1415
class Importer extends Page
1516
{
@@ -40,13 +41,13 @@ public function submit()
4041
}
4142

4243
if ($this->truncate) {
43-
$posts = config('zeus-sky.models.post')::get();
44+
$posts = SkyPlugin::get()->getPostModel()::get();
4445
$posts->each(function ($item, $key) {
4546
$item->tags()->detach();
4647
$item->delete();
4748
});
4849
Schema::disableForeignKeyConstraints();
49-
config('zeus-sky.models.tag')::truncate();
50+
SkyPlugin::get()->getTagModel()::truncate();
5051
Schema::enableForeignKeyConstraints();
5152

5253
Notification::make()
@@ -55,8 +56,6 @@ public function submit()
5556
->send();
5657
}
5758

58-
// get by status todo
59-
// get by post type todo
6059
$posts = Post::where('post_status', '!=', 'auto-draft')->get();
6160

6261
foreach ($posts as $post) {
@@ -78,7 +77,7 @@ public function submit()
7877

7978
public function savePost($post)
8079
{
81-
$zeusPost = config('zeus-sky.models.post')::findOrNew($post->ID);
80+
$zeusPost = SkyPlugin::get()->getPostModel()::findOrNew($post->ID);
8281
if (! $zeusPost->exists || $this->overwrite) {
8382
$zeusPost->id = $post->ID;
8483
$zeusPost->title = $post->post_title;

0 commit comments

Comments
 (0)