CasperSecurity

Current Path : /var/www/finance.uiet.co.in/UietFinance/app/Exports/
Upload File :
Current File : /var/www/finance.uiet.co.in/UietFinance/app/Exports/WorkOrdersExport.php

<?php

namespace App\Exports;

use App\Models\WorkOrders;
use App\Models\Client;
use App\Models\CreateTender;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Carbon\Carbon;


class WorkOrdersExport implements FromCollection, WithHeadings
{
    /**
    * @return \Illuminate\Support\Collection
    */
    public function collection()
    {
        $workorderDetails = [];

        $data = WorkOrders::where('status', 1)->get();

        foreach ($data as $d) {
            $client = Client::find($d->client_id);
            $tender = CreateTender::find($d->tender_id);
            $renewal=$d->renewal_required==1?'YES':'NO';

            $workorderDetails[] = [
                'workorder_no' => $d->work_order_no,
                'client_name' => $client ? $client->client_name : 'N/A',
                'tender_name' => $tender ? $tender->tender_name : 'N/A',
                'work_order_date'=>$d->work_order_date,
                'work_order_closing_date'=>$d->work_order_closing_date,
                'renewal_required' => $renewal
            ];
        }

        return collect($workorderDetails);
    }

    /**
     * Return the headings for the Excel file.
     *
     * @return array
     */
    public function headings(): array
    {
        return [
            'Workorder No',
            'Client Name',
            'Tender Name',
            'Work Order Date',
            'Closing Date',
            'Renewal Required'
        ];
    }
}
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY