Skip to content

Commit

Permalink
Merge pull request #17 from lara-zeus/fix--get-model
Browse files Browse the repository at this point in the history
fix get model
  • Loading branch information
atmonshi authored Sep 13, 2023
2 parents c517ceb + d13fc38 commit 0a0fcc9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Filament/Pages/Importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ public function submit()
}

if ($this->truncate) {
$posts = SkyPlugin::get()->getPostModel()::get();
$posts = SkyPlugin::get()->getModel('Post')::get();
$posts->each(function ($item, $key) {
$item->tags()->detach();
$item->delete();
});
Schema::disableForeignKeyConstraints();
SkyPlugin::get()->getTagModel()::truncate();
SkyPlugin::get()->getModel('Tag')::truncate();
Schema::enableForeignKeyConstraints();

Notification::make()
Expand Down Expand Up @@ -77,7 +77,7 @@ public function submit()

public function savePost($post)
{
$zeusPost = SkyPlugin::get()->getPostModel()::findOrNew($post->ID);
$zeusPost = SkyPlugin::get()->getModel('Post')::findOrNew($post->ID);
if (! $zeusPost->exists || $this->overwrite) {
$zeusPost->id = $post->ID;
$zeusPost->title = $post->post_title;
Expand Down

0 comments on commit 0a0fcc9

Please sign in to comment.