/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $profile = Profile::findOrFail($id); if ($this->userNotOwnerOf($profile)) { throw new UnauthorizedException(); } Profile::destroy($id); if (Auth::user()->isAdmin()) { alert()->overlay('Attention!', 'You deleted a profile', 'error'); return Redirect::route('profile.index'); } alert()->overlay('Attention!', 'You deleted a profile', 'error'); return Redirect::route('home'); }