MOON
Server: Apache
System: Linux e2e-78-16.ssdcloudindia.net 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
User: imensosw (1005)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/imensosw/www/ezwork/app/Http/Controllers/GenderController.php
<?php

/**
 * GenderController class file
 *
 * PHP Version 7.2
 *
 * @category Controller
 * @package  Ez
 * @author   Imenso Software <admin@imensosoftware.com>
 * @license  http://imensosoftware/license.php GNU Public License
 * @link     http://imensosoftware.com/recipes
 */

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Models\Gender;
use App\Models\Language;
use App\Models\Proficiency;
use App\Models\Subject;
use App\Models\Expertise;
use App\Models\Software;
use App\Models\SoftwareTool;
use App\Models\PhotoProofType;
use App\Models\AddressProofType;
use App\Models\Experience;
use App\Models\ExperienceType;
use App\Models\TimeSlot;
use App\Models\PaymentMethodType;
use App\Models\Country;

/**
 * GenderController class
 *
 * The class manage the Gender
 *
 * @category GenderController
 * @package  Ez
 * @author   Imenso Software <admin@imensosoftware.com>
 * @license  http://imensosoftware/license.php GNU Public License
 * @link     http://imensosoftware.com/recipes
 */

class GenderController extends Controller
{


    /**
     * GetGenders function gets the list of gender and
     * return it in json format.
     *
     * @param  void
     * @return json
     */
    public function getGenders(): \Illuminate\Http\JsonResponse
    {
        $genders = Gender::get();
        return response()->json(
            [
                'status'  => 'success',
                'genders' => $genders->toArray(),
            ],
            200
        );
    }
    //  end getGenders()


    /**
     * GetTranlationMasters function gets all master required in translator
     * profile in and return it in json format.
     *
     * @param  void
     * @return json
     */
    public function getTranlationMasters(): \Illuminate\Http\JsonResponse
    {
        $genders            = Gender::get();
        $languages          = Language::get();
        $proficiencys       = Proficiency::get();
        $subjects           = Subject::get();
        $expertises         = Expertise::get();
        $softwares          = Software::get();
        $software_tools     = SoftwareTool::get();
        $photoProofTypes    = PhotoProofType::get();
        $addressProofTypes  = AddressProofType::get();
        $experiences        = Experience::get();
        $experienceTypes    = ExperienceType::get();
        $timeSlots          = TimeSlot::get();
        $paymentMethodTypes = PaymentMethodType::get();
        $countries          = Country::get();

        $user_id            = Auth::user()->id;
        $request['user_id'] = $user_id;
        $userBankAccounts   = \App\Models\UserBankAccount::getUserBankAccounts($request);

        
        $request['user_id']     = $user_id;
        $userDayTimeSlotsPivote = \App\Models\UserAvailability::getUserDayTimeSlotsPivote($request);

        $userIdentification = \App\Models\UserIdentification::getUserIdentification(['user_id' => $user_id]);

        $userContract = \App\Models\UserContract::getUserContract($request);

        return response()->json(
            [
                'status'                 => 'success',
                'genders'                => $genders->toArray(),
                'languages'              => $languages->toArray(),
                'proficiencys'           => $proficiencys->toArray(),
                'subjects'               => $subjects->toArray(),
                'expertises'             => $expertises->toArray(),
                'softwares'              => $softwares->toArray(),
                'software_tools'         => $software_tools->toArray(),
                'photoProofTypes'        => $photoProofTypes->toArray(),
                'addressProofTypes'      => $addressProofTypes->toArray(),
                'experiences'            => $experiences->toArray(),
                'experienceTypes'        => $experienceTypes->toArray(),
                'timeSlots'              => $timeSlots->toArray(),
                'paymentMethodTypes'     => $paymentMethodTypes->toArray(),
                'countries'              => $countries->toArray(),
                'userBankAccounts'       => $userBankAccounts,
                'userDayTimeSlotsPivote' => $userDayTimeSlotsPivote,
                'userIdentification'     => $userIdentification,
                'userContract'           => $userContract,
                
            ],
            200
        );
    }
    //  end getTranlationMasters()
}
//  end class