示例#1
0
 function locationEdit(Request $request)
 {
     $id = $request->input('lc');
     if (!$id) {
         return redirect()->back();
     }
     $tests = DB::table('tests')->join('parameters', 'tests.parameter_id', '=', 'parameters.id')->join('states', 'tests.state_id', '=', 'states.id')->join('methods', 'tests.method_id', '=', 'methods.id')->join('test_methods', 'tests.test_method_id', '=', 'test_methods.id')->select('tests.id', 'tests.price', 'parameters.name as parameter', 'states.name as state', 'methods.name as method', 'states.name as state', 'test_methods.name as test_method')->orderBy('parameters.name')->get();
     $location = TestLocation::find($id);
     $locations_type = LocationType::get();
     return view('customers.locationEdit')->with(compact('location', 'tests', 'locations_type'));
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy(Request $request, $id)
 {
     if ($id) {
         LocationType::destroy($id);
         Session::flash('flash_message', 'Location type has been deleted successfully.');
         Session::flash('flash_type', 'alert-success');
     }
     return redirect('admin/location-types');
 }