Пример #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param Ad $ad
  *
  * @return Response
  */
 protected function destroy(Ad $ad, $forceDelete)
 {
     $adstatus = Adstatus::whereTitle('trashed')->first();
     $ad->adstatus()->associate($adstatus);
     $ad->save();
     event(new AdWillBeDeleted($ad, $this->admin, $forceDelete));
     if ($forceDelete) {
         $ad->forceDelete();
     } else {
         $ad->delete();
     }
     event(new AdWasDeleted($ad, $this->admin, $forceDelete));
 }
Пример #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param Ad $ad
  *
  * @return Response
  */
 public function destroy(Ad $ad)
 {
     $adstatus = Adstatus::whereTitle('trashed')->first();
     $ad->adstatus()->associate($adstatus);
     $ad->save();
     event(new AdWillBeDeleted($ad, $this->user));
     $ad->delete();
     event(new AdWasDeleted($ad, $this->user));
 }