Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alpgokcek/spa-analyzer-api
SPA Analyzer System
https://github.com/alpgokcek/spa-analyzer-api
Last synced: 20 days ago
JSON representation
SPA Analyzer System
- Host: GitHub
- URL: https://github.com/alpgokcek/spa-analyzer-api
- Owner: alpgokcek
- Created: 2019-12-02T13:31:21.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T12:09:38.000Z (about 2 years ago)
- Last Synced: 2024-11-01T11:04:01.815Z (2 months ago)
- Language: PHP
- Size: 18.9 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 30
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# ITC Content Management System
[itcContentManagement](https://itc.ideateknoloji.com.tr)
# Listing
##### Paginate
```sh
$data = MODEL::paginate(10)
```
You can http://xxx.com/model?page=1,2,3##### Offset - Limit
```sh
$offset = $request->offset ? $request->offset : 0;
$limit = $request->limit ? $request->limit : 10;
$data = Customer::offset($offset)->limit($limit)->get();
```##### Sorting
```sh
?sortBy=id&sort=DESC
```
# Createif form and tables are same
```sh
$data = MODEL::create($request->all());
```
if not
```sh
$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);
}
```
# API CONTROLLERcontrollerın yorumunu Controller yerine ApiController üzerinden çağırıp
```sh
class DATAController extends ApiController
```
```sh
return $this->apiResponse(ResultType::Success, $data, null, 201);
return $this->apiResponse(ResultType::Error, null, null, 500);
```# Installation
PHP 7>
Laravel 6
Vue.js 2 (vue cli 3)
Bootstrap```sh
$ cd www/itc
$ composer update
$ npm install -d
$ php artisan serve
```