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