app/Http/Controllers/FrontExerciciosController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\RedirectResponse
     */
Remove the specified resource from storage.
@param  int  $id
@return \Illuminate\Http\RedirectResponse
Remove the specified resource from storage . @param int $id @return \ Illuminate \ Http \ RedirectResponse
public function destroy($id)
    {
        $exercicio = ExercicioModel::findOrFail($id);
        if(file_exists($exercicio->imagem)){
            unlink($exercicio->imagem);
        }
        $exercicio->delete();
        flash('Exercício Excluído com Sucesso')->success();
        return  redirect()->route('exercicio.index');
    }
public function destroy ( $ id ) { $ exercicio = ExercicioModel :: findOrFail ( $ id ) ; if ( file_exists ( $ exercicio -> imagem ) ) { unlink ( $ exercicio -> imagem ) ; } $ exercicio -> delete ( ) ; flash ( 'Exercício Excluído com Sucesso')- > su ccess() ; return redirect ( ) -> route ( 'exercicio.index' ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .