unioil-loyalty-app/app/Http/Controllers/API/CodeGenderController.php

43 lines
859 B
PHP
Executable File

<?php
namespace App\Http\Controllers\API;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Contracts\CodeGenderResourceInterface;
use App\Helpers\HttpStatusCode;
class CodeGenderController extends Controller
{
public $gender;
protected $format;
protected $module;
protected $model;
public function __construct(CodeGenderResourceInterface $gender,HttpStatusCode $httpStatusCode)
{
$this->gender = $gender;
$this->format = $httpStatusCode;
}
public function get_all()
{
$data = $this->gender->getAll();
$return = [];
foreach ($data as $key => $value) {
$return[] = [
'name' => $value->description,
'gender_uuid' => $value->gender_uuid
];
}
return $this->format->mobile_success('Success',$return);
}
}