Esempio n. 1
0
 /** Remove the specified resource from storage.
     	@param $hstokout
     	@return Response
     */
 public function postDelete($hstokout)
 {
     // Declare the rules for the form validation
     $rules = array('idkode' => 'required');
     // Validate the inputs
     $validator = Validator::make(Input::all(), $rules);
     // Check if the form validates with success
     if ($validator->passes()) {
         $idkode = $hstokout->klr_no;
         $hstokout->delete();
         // Was the blog hstokout deleted?
         $hstokout = Hstokout::find($idkode);
         if (empty($hstokout)) {
             // Redirect to the blog hstokouts management page
             return Redirect::to('admin/hstokouts')->with('success', Lang::get('admin/hstokouts/messages.delete.success'));
         }
     }
     // There was a problem deleting the blog hstokout
     return Redirect::to('admin/hstokouts')->with('error', Lang::get('admin/hstokouts/messages.delete.error'));
 }