Skip to content

Commit

Permalink
Merge pull request #47 from laravelcm/fix-bug-update-article
Browse files Browse the repository at this point in the history
🐛 correction du bug lors de l'edition d'un article
  • Loading branch information
mckenziearts authored Jun 16, 2022
2 parents cf0de41 + 20d6d68 commit eb3efa1
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions app/Http/Livewire/Articles/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
use App\Models\Article;
use App\Models\Tag;
use App\Models\User;
use App\Notifications\SendSubmittedArticle;
use App\Traits\WithArticleAttributes;
use App\Traits\WithTagsAssociation;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Notification;
use Livewire\Component;
use Livewire\WithFileUploads;

Expand Down Expand Up @@ -76,14 +74,6 @@ public function save()
$this->article->addMedia($this->file->getRealPath())->toMediaCollection('media');
}

if (! $this->alreadySubmitted) {
// Envoi du mail a l'admin pour la validation de l'article
$admin = User::findByEmailAddress('[email protected]');
Notification::send($admin, new SendSubmittedArticle($this->article));

session()->flash('status', 'Merci d\'avoir soumis votre article. Vous aurez des nouvelles uniquement quand nous accepterons votre article.');
}

Cache::forget('post-' . $this->article->id);

$user->hasRole('user') ?
Expand Down

0 comments on commit eb3efa1

Please sign in to comment.