phpvms/app/Http/Controllers/Api/SettingsController.php

41 lines
935 B
PHP
Raw Normal View History

<?php
namespace App\Http\Controllers\Api;
use App\Http\Resources\Setting as SettingResource;
use App\Interfaces\Controller;
2018-02-21 12:33:09 +08:00
use App\Repositories\SettingRepository;
use Illuminate\Http\Request;
/**
* Class SettingsController
* @package App\Http\Controllers\Api
*/
class SettingsController extends Controller
{
private $settingRepo;
2018-02-21 12:33:09 +08:00
/**
* SettingsController constructor.
* @param SettingRepository $settingRepo
*/
public function __construct(
SettingRepository $settingRepo
) {
$this->settingRepo = $settingRepo;
}
/**
* Return all the airlines, paginated
2018-02-21 12:33:09 +08:00
* @param Request $request
* @return \Illuminate\Http\Resources\Json\AnonymousResourceCollection
*/
public function index(Request $request)
{
$settings = $this->settingRepo
->orderBy('order', 'asc')->get();
return SettingResource::collection($settings);
}
}