private function _gen_support($id_client) { $support = ClientSupport::where("id_client", "=", $id_client)->get(); $res = []; foreach ($support as $c) { $res[$c->id_support] = $c->support->nama; } return $res; }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // $client = Client::find($id); $cs = ClientSupport::where('id_client', $id)->delete(); $user = User::find($client->id_user)->delete(); $client->delete(); Session::flash("success", "Success Delete Client"); }