$data = MODEL::paginate(10)
You can http://xxx.com/model?page=1,2,3
$offset = $request->offset ? $request->offset : 0;
$limit = $request->limit ? $request->limit : 10;
$data = Customer::offset($offset)->limit($limit)->get();
?sortBy=id&sort=DESC
if form and tables are same
$data = MODEL::create($request->all());
if not
$data = new MODEL();
$data->table1 = request('input1');
$data->slug = Str::slug(request('title'));
$data->integer = 2;
$data->save();
if ($data) {
return $this->apiResponse(ResultType::Success, $data, 'Content Created', 201);
} else {
return $this->apiResponse(ResultType::Error, null, 'Content not saved', 500);
}
controllerın yorumunu Controller yerine ApiController üzerinden çağırıp
class DATAController extends ApiController
return $this->apiResponse(ResultType::Success, $data, null, 201);
return $this->apiResponse(ResultType::Error, null, null, 500);
PHP 7> Laravel 6 Vue.js 2 (vue cli 3) Bootstrap
$ cd www/itc
$ composer update
$ npm install -d
$ php artisan serve