app/Http/Controllers/UsahaFotoController.php
/**
	 * Remove the specified resource from storage.
	 *
	 * @param  \App\UsahaFoto  $usahaFoto
	 * @return \Illuminate\Http\Response
	 */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy($id) {
		try {
			$galeri = $this->data->find($id);
			if ($galeri->foto) {
				File::delete(public_path() . $galeri->foto);
			}
			$galeri->delete();
		} catch (FileNotFoundException $e) {
		}
		return redirect()->route('usahafoto.index', $galeri->usaha_id)->with('success', 'Image deleted successfully');
	}
public function destroy ( $ id ) { try { $ galeri = $ this -> data -> find ( $ id ) ; if ( $ galeri -> foto ) { File :: delete ( public_path ( ) . $ galeri -> foto ) ; } $ galeri -> delete ( ) ; } catch ( FileNotFoundException $ e ) { } return redirect ( ) -> route ( 'usahafoto.index' , $ galeri -> usaha_id ) -> with ( 'success' , 'Image deleted successfully' ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .
// File::delete($galeri->foto);