예제 #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //
     \App\DcLocation::create(['location_name' => 'TBS Lt.1']);
     \App\DcLocation::create(['location_name' => 'TBS Lt.2']);
     \App\DcLocation::create(['location_name' => 'TBS Lt.3']);
     \App\DcLocation::create(['location_name' => 'BDG Lt.1']);
     \App\DcLocation::create(['location_name' => 'BDG Lt.2']);
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function getCreate()
 {
     $dc_customers = DcCustomers::all();
     $dc_customer = "";
     $customers = Customers::all();
     $customer = "";
     $locations = DcLocation::all();
     $location = "";
     $service_types = ServiceType::all();
     $service_type = "";
     return view('admin.customers.create_edit_dc_customer', compact('dc_customer', 'dc_customers', 'location', 'locations', 'service_type', 'service_types', 'customers', 'customer'));
 }
 /**
  * Reorder items
  *
  * @param items list
  * @return items from @param
  */
 public function getReorder(ReorderRequest $request)
 {
     $list = $request->list;
     $items = explode(",", $list);
     $order = 1;
     foreach ($items as $value) {
         if ($value != '') {
             DcLocation::where('id', '=', $value)->update(array('position' => $order));
             $order++;
         }
     }
     return $list;
 }