KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.41 (Ubuntu)
System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64
User : www-data ( 33)
PHP Version : 8.2.12
Disable Function : NONE
Directory :  /var/www/coaching/coaching.bizkrypt.com/app/Exports/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/coaching/coaching.bizkrypt.com/app/Exports/TempStudentExport.php
<?php

namespace App\Exports;

use Illuminate\Support\Facades\DB;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\FromCollection;
use Illuminate\Support\Facades\Session;
use App\Models\{
    DummyAdmission
};
use Maatwebsite\Excel\Concerns\FromArray;

class TempStudentExport implements FromArray, WithHeadings
{

    public function array(): array
    {
        // Query
        $students = DB::table('dummy_admissions')->select(
                 "id",
                "course_class",
                "attempt",
                "adm_code",
                "code",
                "date",
                "aadhar_no",
                "ICAI_reg",
                "dob",
                "gender",
                "profile_pic",
                "student_name",
                "father_name",
                "father_occupation",
                "mother_name",
                "address",
                "city",
                "state",
                "pincode",
                "village",
                "mobile_personal",
                "mobile_father",
                "mobile_guardian",
                "email",
                "school_last_attend",
                "tution_account_teacher_name",
                "tution_account_teacher_phone",
                "school_account_teacher_name",
                "school_account_teacher_phone",
                "tution_math_teacher_name",
                "tution_math_teacher_phone",
                "school_math_teacher_name",
                "school_math_teacher_phone",
                "subject_12th",
                "marks_10th",
                "expected_12th",
                "other",
                "medium_8th",
                "tenth",
                "class_12th",
                "medical_problem",
                "ca_in_family",
                "relative_name"
            
        )->orderBy('created_at', 'DESC')->get();     



        /*$query->orderBy('created_at', 'DESC');
        $students = $query->get(
            [
                 "id",
                "course_class",
                "attempt",
                "adm_code",
                "code",
                "date",
                "aadhar_no",
                "ICAI_reg",
                "dob",
                "gender",
                "profile_pic",
                "student_name",
                "father_name",
                "father_occupation",
                "mother_name",
                "address",
                "city",
                "state",
                "pincode",
                "village",
                "mobile_personal",
                "mobile_father",
                "mobile_guardian",
                "email",
                "school_last_attend",
                "tution_account_teacher_name",
                "tution_account_teacher_phone",
                "school_account_teacher_name",
                "school_account_teacher_phone",
                "tution_math_teacher_name",
                "tution_math_teacher_phone",
                "school_math_teacher_name",
                "school_math_teacher_phone",
                "subject_12th",
                "marks_10th",
                "expected_12th",
                "other",
                "medium_8th",
                "tenth",
                "class_12th",
                "medical_problem",
                "ca_in_family",
                "relative_name"
            ]
        );*/

        $collection = array();
         foreach ($students as $student) {
            
            array_push($collection, $student);
        }
        return $collection;

    }

    public function headings(): array
    {
        return [
            "id",
                "course_class",
                "attempt",
                "adm_code",
                "code",
                "date",
                "aadhar_no",
                "ICAI_reg",
                "dob",
                "gender",
                "profile_pic",
                "student_name",
                "father_name",
                "father_occupation",
                "mother_name",
                "address",
                "city",
                "state",
                "pincode",
                "village",
                "mobile_personal",
                "mobile_father",
                "mobile_guardian",
                "email",
                "school_last_attend",
                "tution_account_teacher_name",
                "tution_account_teacher_phone",
                "school_account_teacher_name",
                "school_account_teacher_phone",
                "tution_math_teacher_name",
                "tution_math_teacher_phone",
                "school_math_teacher_name",
                "school_math_teacher_phone",
                "subject_12th",
                "marks_10th",
                "expected_12th",
                "other",
                "medium_8th",
                "tenth",
                "class_12th",
                "medical_problem",
                "ca_in_family",
                "relative_name"
        ];
    }
}

Anon7 - 2021