public function data() { $limit = $this->request->has('limit') ? $this->request->get('limit') : 10; $offset = $this->request->has('offset') ? $this->request->get('offset') : 0; $query = new Express(); $total = $query->count(); $orders = $query->skip($offset)->take($limit)->get(); return array('total' => $total, 'rows' => $orders); }
public function create($input) { $express = new Express(); $express->name = $input['name']; if ($express->save()) { return true; } return new GeneralException(trans('exceptions.backend.article.create_error')); }