Exemplo n.º 1
0
 public function getUrl()
 {
     $gallery = Gallery::find($this->gallery_id);
     return url($this->hasPrepend() . 'gallery_assets/galleries', [$gallery->slug, $this->file]);
 }
Exemplo n.º 2
0
 public function deleteGallery($id)
 {
     $gallery = Gallery::findOrFail($id);
     if ($gallery->delete()) {
         return json_encode(true);
     } else {
         abort('404', 'Error on delete');
     }
 }