api code global jain

This commit is contained in:
Abhishek Mali
2025-11-05 10:37:10 +05:30
commit 52fe7e2bec
2834 changed files with 1784903 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
<?php
namespace App\Repositories\Api\Access\MotherTongue;
interface MotherTongueInterface
{
public function getMotherTongueList();
}

View File

@@ -0,0 +1,55 @@
<?php
namespace App\Repositories\Api\Access\MotherTongue;
use App\Constant\Constant;
use App\Models\MotherTongue;
use Illuminate\Support\Facades\Log;
use App\Repositories\Api\Access\MotherTongue\MotherTongueInterface;
class MotherTongueRepository implements MotherTongueInterface
{
/**
* @var MotherTongue
*/
protected $motherTongue;
/**
* @param MotherTongue $motherTongue
* MotherTongueRepository constructor.
*
*/
public function __construct(MotherTongue $motherTongue)
{
$this->motherTongue = $motherTongue;
}
/**
* @return array
*/
public function getMotherTongueList()
{
$response = [];
try {
$user = loggedInUser();
$data = $this->motherTongue->get()->toArray();
if ($user && $data) {
$response['data'] = $data;
$response['status'] = Constant::CODE_200;
} else {
$response['data'] = [];
$response['status'] = Constant::CODE_401;
}
} catch (\Exception $ex) {
Log::error($ex);
$response['message'] = trans('auth.something_went_wrong');
$response['status'] = Constant::CODE_403;
}
return $response;
}
}