api code global jain
This commit is contained in:
44
app/Http/Controllers/Api/V1/Access/ProfessionController.php
Normal file
44
app/Http/Controllers/Api/V1/Access/ProfessionController.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\V1\Access;
|
||||
|
||||
use App\Constant\Constant;
|
||||
use App\Http\Controllers\Api\ApiController;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Repositories\Api\Access\Profession\ProfessionInterface as ProfessionRepository;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ProfessionController extends ApiController
|
||||
{
|
||||
/**
|
||||
* @param ProfessionRepository $professionRepository
|
||||
* ProfessionController constructor.
|
||||
*
|
||||
*/
|
||||
public function __construct(ProfessionRepository $professionRepository)
|
||||
{
|
||||
$this->professionRepository = $professionRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$response = [];
|
||||
|
||||
try {
|
||||
$response = $this->professionRepository->index($request->all());
|
||||
$this->setStatusCode($response['status']);
|
||||
|
||||
} catch (Exception $ex) {
|
||||
Log::error($ex);
|
||||
$this->setStatusCode(Constant::CODE_403);
|
||||
}
|
||||
|
||||
return $this->respond($response);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user