Exemplo n.º 1
0
 public function removeImageById($id)
 {
     if (Auth::check()) {
         $image = AdImage::whereId($id)->with('ad')->first();
         if (null !== $image && $image->ad->author_id == Auth::user()->id) {
             return AdImage::remove($id);
         }
     }
     return 0;
 }