public function run() { \App\ObjectType::create(['name' => 'page', 'display_name' => 'Page']); \App\ObjectType::create(['name' => 'article', 'display_name' => 'article']); \App\ObjectType::create(['name' => 'file', 'display_name' => 'File']); \App\ObjectType::create(['name' => 'category', 'display_name' => 'Category']); }
/** * 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 != '') { ObjectType::where('id', '=', $value)->update(array('position' => $order)); $order++; } } return $list; }