/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { // delete Team::destroy($id); // redirect Session::flash('message', 'Successfully deleted the team owner!'); return Redirect::to('view'); }
public static function destroy($id) { $Team = new Team(array('id' => $id)); $Team->destroy(); Redirect::to('/team', array('message' => 'Joukkue on poistettu onnistuneesti!')); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // $team = Team::find($id); Team::destroy($id); if (file_exists(public_path('teams/' . $team->image))) { unlink(public_path('teams/' . $team->image)); } return redirect('team'); }