/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Taller::find(); // add conditions that should always apply here $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } // grid filtering conditions $query->andFilterWhere(['id' => $this->id, 'estadoTaller_id' => $this->estadoTaller_id, 'colaborador_id' => $this->colaborador_id, 'entidad_id' => $this->entidad_id, 'horas' => $this->horas, 'comunas_comuna_id' => $this->comunas_comuna_id]); $query->andFilterWhere(['like', 'nombre', $this->nombre])->andFilterWhere(['like', 'area', $this->area])->andFilterWhere(['like', 'totalParticipantes', $this->totalParticipantes])->andFilterWhere(['like', 'lugarDireccion', $this->lugarDireccion]); return $dataProvider; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $taller = Taller::find($id); $taller->delete(); return redirect()->back(); }