Destroy data

@param $id

@return mixed
971454
public function destroy($id)
    {
        if ($this->model->deleteEnv($id)) {
            $data = [
                'status' => true,
                'message' => trans('admin.delete_succeeded'),
            ];
        } else {

            $data = [
                'status' => false,
                'message' => trans('admin.delete_failed'),
            ];
        }

        return response()->json($data);
    }
500841
public function destroy($id)
    {
        $return = false;

        $record = \Doctrine::getTable($this->_tableName)->find($id);
        if (false !== $record) {
            if ($record->delete()) {
                $return = true;
            }
        }

        return $return;
    }
1072901
public function destroy($id)
    {
        // Create Response Model
        $response = new ResponseModel();

        try {
            $response->setData(collect($this->model->findOrFail($id)->delete()));
            $response->setMessage($this->getTrans('destroy', 'successful'));

        } catch (ModelNotFoundException $exception) {
            $response->setMessage($this->getTrans('destroy', 'successful'));
            $response->setStatus(false);
            $response->setError($exception->getCode());
            if (env('APP_DEBUG', false)) {
                $response->setData(collect($exception->getMessage()));
            }

        }

        return SmartResponse::response($response);
    }
206506
public function destroy($id)
    {
        // get route permission by id
        $routePermission = RoutePermission::find($id);

        if (!$routePermission) {
            return response()->json(null, 404);
        }

        // check current user is admin
        if (!(Auth::user() && Auth::user()->hasRole('admin'))) {
            return response()->json(null, 403);
        }

        // delete route permission
        $deleteRoutePermission = $routePermission->delete();

        if (!$deleteRoutePermission) {
            return response()->json(null, 500); // @codeCoverageIgnore
        }

        return response()->json(null, 204);
    }
1021102
public function destroy($id)
    {
        return $this->app['db']
            ->delete(self::TABLENAME)
            ->where('id', $id)
            ->execute() instanceof PDOStatement;
    }
1077235
public function destroy($id)
      {
        $user = $this->users->findOrFail($id);
        User::destroy($id);
        return \Redirect::route('admin.users.index', [
          ])->withMessage(trans('acl::user.users-controller-successfully_deleted'));
        }
1298670
public function destroy($id)
    {
        $campagne = $this->campagne->find($id);
        $campagne->content()->delete();
        
        $this->campagne->delete($id);

        alert()->success('Campagne supprimée');

        return redirect()->back();
    }
1336672
public function destroy($id)
    {
        $admin = $this->adminRepository->find($id);

        if (!is_null($admin)) {
            $this->adminRepository->destroy($admin);
        }

        return Redirect::route('admin.admin.index');
    }
962429
public function destroy($id)
    {
     	$user_setting = User_setting::findOrfail($id);
     	$user_setting->delete();
        return URL::to('user_setting');
    }
492296
public function destroy($id)
    {
        try {
            $result = $this->service->destroy(Auth::user(), $id);

            if ($result) {
                return redirect('teams')->with('message', 'Successfully deleted');
            }

            return redirect('teams')->with('message', 'Failed to delete');
        } catch (Exception $e) {
            return back()->withErrors($e->getMessage());
        }
    }
352056
public function destroy($id)
    {
        $modelName = $this->getModelName();

        $nodeField = $modelName::findOrFail($id);
        $nodeField->delete();

        $this->builderService->destroyField(
            $nodeField->getName(),
            $nodeField->nodeType->getName(),
            $nodeField->nodeType
        );

        return $nodeField;
    }
951418
public function destroy($id)
    {
        $redirect = $this->redirect->findOrFail($id);

        if($redirect->delete()) return response()->json(['status' => 'ok']);

        return response()->json(['status' => 'failed']);
    }
591118
public function destroy($id)
    {
        $this->model->findOrFail($id)->delete();

        $this->notify([
            'type' => 'danger',
            'title' => 'Successful deleted Role!',
            'description' => 'The role is deleted successfully.',
        ]);

        return redirect()->back();
    }
781617
public static function destroy($id)
    {
        $table = self::getTableNameFromClass();

        self::getOne($id);

        $query = "DELETE FROM $table WHERE id = ".$id;

        try {
            Connection::db()->query($query);
            return true;
        } catch (Exception $e) {
            return false;
        }
    }
851361
public function destroy($id)
    {
        $phone = Phone::findOrFail($id);
        $this->authorize('manage', $phone);
        $phone->delete();
        return fractal($id, new DeletedTransformer())
            ->withResourceName('deletedPhone')
            ->respond();
    }
1025957
public function destroy($id)
    {
        $post = $this->tagRepo->findOrFail($id);
        $post->delete();

        $message = 'El registro se eliminó satisfactoriamente.';

        return [
            'message' => $message
        ];
    }
601409
public function destroy($id)
    {
        if(file_exists($this->path . DS . $id) && is_writable($this->path . DS . $id))
        {
            return unlink($this->path . DS . $id);
        }
        return false;
    }