Exemplo n.º 1
0
 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']);
 }
Exemplo n.º 2
0
 /**
  * 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;
 }